12. Functions and if/else. HELP PLEASE



SyntaxError: Unexpected token {
Oops, try again. There was a problem with your syntax.

var sleepCheck = function (numHours) {
    if (sleepCheck >= 8) {    
    return "You're getting plenty of sleep! Maybe even too much!";
    else (sleepCheck < 8) {
    return "Get some more shut eye!";


else means: everything else, which means you can't check any condition:

else {
  /* what else should execute */


Thanks! (I also had to change if (sleepCheck >=8) to if (numHours >= 8)


i haven't even seen that yet, good catch. I would indeed use the argument you pass into the function, and not the function name, like you discovered yourself :slight_smile: