Learn JavaScript
Number
5.2
Lesson

NaN

In JavaScript, NaN represents a value which is not a number.

Sometimes, we might perform arithmetic operations on values which are not numbers. In such cases, the result is Not a Number or NaN.

In the example given below, the value stored in the num variable contains alphabets along with numbers.

This means that the value of num is not a proper number. Therefore, if we perform any arithmetic operations, it returns NaN.