I just noticed this strange effect
window.onload = undefined;
console.log(window.onload); // print 'null', instead of 'undefined'
While it works as expected for other objects, including built-in, objects, e.g.
Array.prototype.slice = undefined;
console.log(Array.prototype.slice); // print 'undefined'
Why is that the case?
This behavior is like this because
.onloadis a setter and it works something like this: