What's wrong with my syntax?


#1


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


#2

Well first off you are missing an } after your return statement. Second, you are missing sleepCheck(5);
sleepCheck(8); in your code.


#3

your function:

var sleepCheck = function(numHours) {

the { to mark the beginning of your function has no matching } to mark the end of your function.

also:

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

the } of else shouldn't have a semi-colon.

and finally, make sure the strings returned are an exact match


#4

Thanks for your help :smile_cat: :smile:


#5

one } is missing. For the else block you have opened { but by mistake you didn't closed it }.


#6

does it work now?


#7

Yes!!


#8

the question was not addressed to you? I replied to minecraftmaster02


#9

Ok my mistake, ignore my reply


#10

Yes, it did help thanks


#11