It appears that window.undefined
is writable, i.e. it can be set to something else than its default value (which is, unsurprisingly, undefined
).
The point is however that whenever I refer to undefined
, it refers to window.undefined
(as window
can be removed in cases like this).
So how do I actually get access to an undefined
'instance', so to say? How would I be able to set another variable to undefined
, if window.undefined
has been changed?
If I code:
window.undefined = 'foo'; // This code might have been executed by someone/something
var blah = undefined; // blah is not undefined, but equals to 'foo' instead...
How could I possibly solve this?