12 Oops Try again


#1

var sleepCheck = function(numHours){
if(numHours >= 8){
return "Your're getting plenty of sleep! Maybe even to much!";
}else{
return "Get some more shut eye!";
};
};
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));

Have an error

" 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

Hi!
I'm not sure, but maybe you can try not console.log the function result, but only call it?
i did like this - and it's works.


#3

Using console.log here is fine, actually it is better as you can see all 3 outputs and not just the console echo of the last value. The syntax seems to be ok so I'd go for typos and a first guess would be this:

"Your're ...


#4

A post was split to a new topic: 12. there's a problem with my syntax


#6

A post was merged into an existing topic: 12. there's a problem with my syntax