If I create:
Object.prototype.count = function() {};
var m = {prop: 1};
for(var i in m)
window.status += i + ", ";
in the code above i
contains also count
inherited by its prototype. Now I want
to know if there is a way to set a custom property as the flag DontEnum (it is not settable for custom property) so it will not be enumerated.
I know I can do if(m.hasOwnProperty(i))
to check only its property but if I
write a sort of array's API I should say to a programmer to remember that... and
this is not acceptable!