Writing Functions in JS


#1

Hi, guys! I finally got passed that coding exercise I kept posting about but am now stuck at something else:

// 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!";
 ---> whenever I remove this bracket another error message pops up} else {
    return "Get some more shut eye!";
}

sleepCheck(5);

#2

if (numHours >8) // missing {

see comment in code


#3

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