In JavaScript, NaN is a valid value of the number type. console.log(typeof NaN); // number When prompted to verify if a value matches NaN or not, you’ll encounter an irony: NaN doesn’t equate to itself. Therefore, standard equality comparisons are ineffective for checking NaN values. if(NaN === NaN){ console.log(“NaN is equal to NaN”); } elseContinueContinue reading “Which is more suitable to use, isNaN or Number.isNaN() in JavaScript”