Defining the function


#1

var SleepCheck = function (hour) {
if(hour >= 8) {
return "You're getting plenty of sleeo! Maybe even tii much!";
}
else {
return "Get some more shut eye!";
}
}
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);
am i doing something wrong
im having trouble defining the function. What kind of code is it?


#2

Hi your argument should be numHour instead of just hour .
Then you should return the same string they gave you.

return "You're getting plenty of sleep! Maybe even too much!";

#3

shouldn't the function be called sleepCheck? (first letter = lowercase)


#4

can you show me like a screenshot of it
its bit confusing,sorry


#5

You already got like @stetim94 said your function should be sleepCheck() so it wil be like that

var sleepCheck = function(numHour) {
    if (numHours >= 8 ) { 
....................
}

#6

The only thing missing is the semi-colon at the end of the last curly bracket { } holding the function before the sleepCheck(10);.


#7