If we use return in place of console.log and calling a funtion 3 timesbut output is only one?


var sleepCheck=function(hours){
        return ( "You're getting plenty of sleep! Maybe even too much!");
    else {
        return ("Get some more shut eye!");


Your return statements shouldn't have parentheses around the text.


also after this correction output not effected


hmmm, could I see a screenshot?


I believe that the last line of code repeats in the codecademy console. If you wish to see the results of all the sleepCheck values, use console.log.




It does not matter if parens are used or not. This is not a problem.


I didn't know that, probably because a use a language a lot that throws an error if I put parenthesis around my return statements. But I'm always glad to learn something new :slight_smile:


I find parens to be redundant, given the string is delimited, already, but it is valid JS.


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