I think the way to do this is:
function Foo() {
this.sth = null
// or this.sth = undefined;
}
var bar = new Foo();
Foo.prototype = null;
: thebar.__proto__
will point directly toObject.prototype
.- Without
Foo.prototype = null;
: thebar.__proto__
will point toFoo.prototype
, andFoo.prototype.__proto__
points toObject.prototype
Another way:
function Foo() {
// sth...
}
Foo.prototype.sth = undefined;
//or Foo.prototype.sth = null;
var bar = new Foo();