12. Functions & if / else


#1

Hi! can you guys help me? (I speak spanish, so please don´t use very complicated words xD)


Thanks for your attention!


#2

Hi remove the ; after the if condition

if (numHours >= 8); <== this one

#3

Oh my god, thank you! I dont know how I didnt notice that, jaja, thank you very much!


#4

I'm not trying to tell you how to write your code, everyone has a different style but just as a friendly tip indentation helps a lot. Not only when others are reading your code but also when you go back and try to read it.

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