12/13


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

This is my code and its saying, SyntaxError: Unexpected identifier.. anyone know where i went wrong?


#2

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

This is what I got for twelve. Hope it helps.


#3

No semicolons after conditions:

if (numHours>=8); {

PS: And you lack a } to close the function.


#4

The if statement is inside the 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)