Why? Mainly due to undefined
is not a keyword, therefore you are able to create a variable called undefined
and assign it any value
let undefined = 10
Also undefined
is a global property in window
object
'undefined' in window // true
Therefore there is recommendation that use void 0
to repensent undefined
.