Lesson 12 SyntaxError


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!";



just got it. val instead of var


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


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