12 if else, what i am doing wrong


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!")
return "Get some more ■■■■ eye!"

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

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


the error that coming is numhours is not defined.


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


numhours is not defined
but "numHours" is .

Do write for further doubts.


Please find the attachment for the answe

ring my query


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


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)