12. Functions- Can I get a little help


#1

Can I get a little help with mines?

// Write your function below.
// Don't forget to call your function!

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));

this is my code.

I do not see the problem here.


12. Functions
#2

You don't close your string in your return statement :smile:

Try doing this instead

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


#3

I tried it and it keeps saying
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.


#4

Lol thank you . there are so many codes that you can spend days looking for just a simple ". -.-


#5

True, haha :grin: :grin: