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__
Copyright © 2021 Jogjafile Inc.
Obj.prototypeis what you define to be a prototype of every object constructed with:Obj.__proto__is the prototype of the object that is referenced by yourObjvariable itself, whatever it is (eg.Objmay be a function if it's a constructor).Object.prototypeis what will be the prototype of every object constructed withnew Object().Object.__proto__is the prototype of theObjectobject 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.