12 if else, what i am doing wrong


#1

Kindly let me know the correct solution.
Below is my code :
var sleepCheck = function(numHours)
{

if(numhours >= 8)
{
return ("You're getting plenty of sleep! Maybe even too much!")
}
else{
return "Get some more ■■■■ eye!"
}
}
console.log(sleepCheck(10));


12. If/else. What am I doing wrong?
#2

the string you return should be an exact match, in else you already got sh it (need a space, otherwise it won't show) rather then shut


#3

the error that coming is numhours is not defined.


#4

this line:

return "Get some more ■■■■ eye!"

the string you return should be an exact match. It is not, you have shi t instead of shut. I don't care the error is undefined, those are just some regex expressions


#5

numhours is not defined
but "numHours" is .

Do write for further doubts.


#6

Please find the attachment for the answe

ring my query


#7

Credit to @abygrwl29, he found your mistake. on line 8, your condition checks for numhours, this should be numHours (with uppercase H), since that is the name of the variable you pass into the function


#8

always use semi-colon ";" with the statements under { } .
Line 9 and Line 12 , ";" is missing .

numhours , make "h" as "H"
so it appears numHours .(Line 7)