Functions & if / else


#1

i am getting stuck over,
the error is
"Oops, try again. It looks like sleepCheck() isn't returning "You're getting plenty of sleep! Maybe even too much!" when numHours is 10. Check your if / else syntax and whether you're using the correct comparison operator."
please help me out.
Code:

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!";
}
};
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));

`


#2

Please format it correctly. No one can read it.


#4


i hope this is understandable.


#5

the string returned should be an exact match, copy paste it from the instructions


#6

i did but the same error is repeating


#7

can you copy paste an updated version of your code to the forum?


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.