What's wrong with my code?


#1

What’s wrong with my code? I understand that isNaN will tell you true or false if your input is a number or not but for some reason my code can’t find the variable.

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/2?curriculum_id=506324b3a7dffd00020bf661#

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
ReferenceError: Can’t find variable: isNAN

```

var isEven = function(number) {
// Your code goes here!
if (number % 2 === 0) {
return true;
}
else if (isNAN(number)) {
return “Not a number”;
}
else {
return false;
}
};
isEven(5)

<do not remove the three backticks above>

#2

should be,

isNaN

JS is case sensitive.


#3

Thank you! What a stupid mistake!


#4

It can happen to anybody. Be easy on yourself. Mistakes are our friends.


#5

A post was split to a new topic: Why is JavaScript case sensitive?


#6