Lesson 12 SyntaxError


#1


Hi, i'm getting a "SyntaxError: Unexpected identifier" message.
I really don't know what's wrong with my code.
please help.


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


#2

just got it. val instead of var
:disappointed_relieved:


#3

i think the problem is in this line:

val sleepCheck = function (numHours){

you use the wrong keyword (val vs var)

Oops, i didn't see you answered your own question


#4

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