12. Function & if/else


#1

I've been sitting and watching it for like an hour and i can't seem to find the mistake. The 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(8));

The error: "SyntaxError: missing before statement"

I just can't figure it out. Help needed.


#2

from the instructions:

Inside the function, write an if statement

your if and else statement are not inside the function.


#4

which means you shouldn't remove }, you should put it at the right spot, what do you think spot is? What should be part of the function?


#5

Thanks, I got it. I can't believe I was making this silly mistake.


#6

How the heck do I do this? Please help me.


#7

#8

please go here, make a new topic, fill in the template so we can help you