It appears that window.undefined is writable, i.e. it can be set to something else than its default value (which is, unsurprisingly, undefined).
window.undefined
undefined
It's should be enough to just declare a variable without assigning it to anything:
var local_undefined; alert(typeof local_undefined);
But why on Earth is it possible to change undefined value? Does anyone know history behind this?