12. Funtions & if/else: How the heck do I do this!?!?


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: missing ) after argument list


Replace this line with your code. 
var sleepCheck = function(numHours) {
 if (numHours >=8) {
    return "You're getting plenty of sleep! Maybe even too much!";
} 
    else {
    return "Get some more shut eye!";
}
};
console.log(sleepCheck(10);
console.log(sleepCheck(5);
console.log(sleepCheck(9);


#2

will someone help me before I explode!!!


#3

here:

console.log(sleepCheck(10);

check how many parentheses there are


#4

That's exaclty what I have...


#5

I sent you a message


#6

@stetim94
see if any of your friends can find anything


#7

I figured it out

var sleepCheck = function(numHours)
{
if (numHours >= 8)
{
return ("You're getting plenty of sleep! Maybe even too much!");
}
else
{
return ("Get some more shut eye!");
}
};
sleepCheck(8)


#8

yes, i show where the problem is and then below i explain what is wrong:

if you then look at your parentheses, you see you have 2x ( and 1x )


#9

okay, I just figured it out


#10

By working around the problem, yes


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.