Functions & if / else------how this code in not working?


#1

// 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!";
} else {
return "Get some more shut eye!";
}
};

console.log(sleepCheck(10));


#2

It's only because you haven't written the exact output of "You're getting plenty of sleep! Maybe even too much!" Otherwise your function is working correctly. Also, you may want to rethink your file names when uploading pictures :grin: Cheers!


#3

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