12. Functions & if / else


Hi, So far for my code i have done the following:

var sleepCheck = function (numHours) {
if (numberHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
} else {
return "Get some more shut eye!";

This works fine and allows me to go to the next lesson, however, when i add:


the console comes up with the error:

"ReferenceError: numHours is not defined"

Can someone tell me why it is doing this as i would like it to appear in my console with the answers?!


You change the name of the argument:

var sleepCheck = function (numHours) {
if (numberHours >= 8) {

It goes from 'numHours' to 'numberHours'.


Thank you i was looking at it for ages!