The NaN property means a "Not-a-Number" value. This property tells us that a value is not a legal number.

When there is an operation to produce some undefined result,Nan is produced. For example, any number divided by 0.0 is arithmetically undefined.Also, the square root of a negative number is also undefined in maths, so it is Nan.

According to IEEE 754, there are two types of NaN: quiet and signaling.