Function Malfunction need some action, please help


#1

Hey guys,

Just started learning to code with JS.

I got stuck lately with my lesson in JS about functions, I couldn't figure out how to properly write the if/else syntax inside function. And finally call it to finished.

Maybe you could help me out.

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

I'm getting this as a response below after I run the code above;

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.


#2

Missing space character:

    "You're getting plenty of sleep! Maybe even too much!"

#3

You saved my life!!! That was awesome!Thanks you much mtf!
I never thought that space would matter.