Javascript - Stuck in Functions


#1

Hi, I am kind of stuck at Functions - if/else (number 12 in the chapter just before conclusion)

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

I am supposed to get the result = You're getting plenty of sleep! Maybe even too much! But I am getting the result"Get some more shut eye".
Not sure what I have done wrong. Could anyone please help?


#2

Here is it:

function sleepCheck(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);


#3

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