Functions & if/else


#1

Hi, I'm having trouble understanding why my code isn't being accepted - The error message keeps saying this:

Here's my code - I've looked at it and the instructions for this exercise, up and down, several times over, but apparently I'm missing something:


#2

I haven't attempted Javascript in a while, but I feel like there should be a variable somewhere. You use sleepCheck in your if/else statement, but you don't seem to have anything clarifying what sleepCheck is; you don't have anything clarifying what numHours is either.


#3

try trading out the function name for the parameter you're using,

example:

function exampleFunction(exampleParameter){
   if(exampleParameter >= 8) {

   }
}

Where as you have this:

function exampleFunction(exampleParameter){
   if(exampleFunction >= 8) {

   }
}

That doesn't really make sense if you think about it.


#4

remove** ;** from 12th line it will solve your problem


#5

I tried your suggestion, and I'm still having issues - Any other ideas? - Thank you...


#6

I'm not sure I know what you mean, could you please clarify - Maybe I'm missing something, but your top code looks the same as the code on the bottom that you put up - It could just be me, but I don't know...


#7

Look closely between the parenthesis for my two if statements. That's the difference between "exampleFunction" and "exampleParameter"


#8

Just got it - Thanks!!!