Multiple outputs?


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661#


how can i get multiple output statements?
we can have more than one output at once right?
or is it only one output for now?


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


#2

anything you want to log to the console, you need to use console.log(), so you can have multiply outputs, for example if you want to print tne result of the function call you can do:

console.log(sleepCheck(10));

#3

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