12. Functions & if / else


#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! Maybe even too much!";
}
    else{
        return "Get some more shut eye!";
    }
    
};
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);


i was calling the function for three times with different values , but the function just gives an output. i cannot understand why it didnt gives an output for all calling .


#2

the functions only return, they do not log anything

to log what a function return call console.log() on the sleepCheck function calls


#3

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