I think this works;
Obj.__proto__ = Object.__proto__
in that it passes same objects to left object. if not, please correct me.
Want to figure out
how
Obj.prototype
differs from Obj.__proto__
I think this works;
Obj.__proto__ = Object.__proto__
in that it passes same objects to left object. if not, please correct me.
Want to figure out
how
Obj.prototype
differs from Obj.__proto__
Obj.prototype
is what you define to be a prototype of every object constructed with:Obj.__proto__
is the prototype of the object that is referenced by yourObj
variable itself, whatever it is (eg.Obj
may be a function if it's a constructor).Object.prototype
is what will be the prototype of every object constructed withnew Object()
.Object.__proto__
is the prototype of theObject
object itself.But
__proto__
is not standard. SeeObject.getPrototypeOf()
for a standard way to get some object's prototype in ECMAScript 5.1 and ECMAScript 6.