Prototype Chain

Notes For Js prototype Chain

prototype is a key concept in js. for detail refer here. we need to keep these things in mind.
. in js everything is a object including : function, object.
. every object has a property called: proto, it refers to the prototype of this object, so we can set it our self.
. every function has a special property called prototype, it refer to an object, if we use new to create an object from this function, the created object's _proto_ refers to the prototype of the function.
we also call this function as constructor.
. if we use Consturctor way to create an object, js will implicitly assign the method's prototype to the _proto_ of the object.
. modification of inherited property will create an override property in the child object.

原文地址:https://www.cnblogs.com/kongshu-612/p/6000325.html