If I add a property to Object.prototype like Object.prototype.sth = "something";
then, is there a way to hide the property for a specified object? I tried like this:
function Foo() {
// sth...
}
Foo.prototype = null;
var bar = new Foo();
however, bar still have access to the property sth;
bar.__proto__ = null
or Foo.prototype.__proto__ = null
works