DEV Community

Discussion on: The Difference Between Null and Undefined in JavaScript

Collapse
 
eljayadobe profile image
Eljay-Adobe

Another fun difference:

var v = void 0 // ... which is undefined
var u = undefined
var n = null
console.log(v === u) //> true
console.log(+u) //> NaN
console.log(+n) //> 0
Enter fullscreen mode Exit fullscreen mode