Lesson 12


#1

var sleepCheck = function(numHours) {
if (numHours >= 8) {

    return "You're getting plenty of sleep! Maybe even too much!";


} else (numHours < 8) {

    return "Get some more shut eye!";

}

};

console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));

im keeping getting syntax error... can any1 help me and find that error?


#2

on else you don't have a condition as the else runs if the if statement's condition is true

Read more on if/else statements here


#3

thanks! for the help, i got it =]