How is isNaN applied to the code in lesson 2?


#1

I don't know how to apply the isNaN to the else if statement. Please help?


#2

isNaN(x) is false if it is a number and true if it is not a number.


#3

Here's an example as to how it's used

if (isNaN("Kittens")) {
console.log("I can confirm, kittens are not numbers!");
} else {
console.log("Kittens are numbers?!");
};

That will print to the console "I can confirm, kittens are not numbers!" because isNaN stands for "Is Not a Number"