DEV Community

Discussion on: What is the oddest JavaScript behavior?

Collapse
 
daniel12fsp profile image
daniel12fsp • Edited

this is semantic wrong but it's valid....

isNaN(undefined)  // true

// Correct way

Number.isNaN(undefined) //false
Collapse
 
antogarand profile image
Antony Garand

This makes sense if you assume isNaN means is Not a number, and not is the nan value!