Functions & if / else


#1

help me
code produces output but still i cant save and submit

code :-
// Write your function below.
// Don't forget to call your function!
var sleepCheck = function (numHours)
{
if(numHours >= 8)
{
return "You're are getting plenty of sleep! Maybe even too much !";

}
else
{
    return "Get some more shut eye !";
}

}
sleepCheck(10);

output :-
"You're are getting plenty of sleep! Maybe even too much !"

error :-
Oops, try again. It looks like sleepCheck() isn't returning "You're getting plenty of sleep! Maybe even too much!" when numHours is 10. Check your if / else syntax and whether you're using the correct comparison operator.


#2

You have a space between much and !", when it comes to string return it comes really exact, i recommend copying these strings from the instructions


#3


What is wrong?


#4

@microace01843

put a { after the (numHours) where you've declared the SleepCheck Function.

so

var sleepCheck = function(numHours) {

and then put another } after your last }


#5

like @benjnev says, your function is missing it's curly brackets, everything which is part of the function should be between curly brackets