isNaN

Javascript

isNaN('') = false 😅, how to handle it?

I recently noticed that `isNaN('')` and `isNaN(null)` both return `false` in JavaScript. It means that both empty string and `null` are valid numbers. So if you want to perform any number specific operation by just comparing the variable using `isNaN()`, it won't work.

Read