The issue at hand is that when using
Object.getOwnPropertyNames(window)
, the setTimeout value is not included in the returned array.
Why is this happening?
In an attempt to further investigate, I tried checking the property descriptor object of the setTimeout property by using
Object.getOwnPropertyDescriptor(window,"setTimeout")
, but it returned undefined.
var windowProp = Object.getOwnPropertyNames(window);
for(var i=0; i< windowProp.length; i++){
console.log(windowProp[i]);}
// The setTimeout value does not appear in the console output
Object.getOwnPropertyDescriptor(window,"setTimeout")
// Returns undefined