What is my problem -? Lesson 12 Functions & if/else


#1



I cannot solve this lesson. I have reviewed the previous entries for this lesson and I must be overlooking something. Please help, if you can!


The error message I keep getting is:
SyntaxError: missing variable name

Here is the code I am using:

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(8));

#2

Hi this line

var (sleepCheck) = function(numHours)

try to remove the () around sleepCheck


#3

Ha! Thanks wiz kid. Thanks a bunch. I am now getting another error, but I'll work through it. I think it's a problem with the console.log.


#4

yes it will be that string

return "You're getting plenty of sleep. Maybe even too much!";

i should be like the one they gave you in the instruction...


#5

I see that now. Thanks again wiz kid.


#6

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