我理解的原型链和原型对象

1. 我的理解

原型链是一种链式继承 ,体现在 __proto__
原型对象是一个对象 ,即 prototype

//原型链继承  可以看成__proto__继承自 parent prototype, 直至Object.__proto__==null
instance.__proto__ = class/function .prototype 

class/function.prototype.constructor = instance.__proto__.constructor = class/function

Function.prototype = {
  constuctor: Function
  __proto__: parent prototype
}

2. 看张图吧

image

参考
https://www.jianshu.com/p/aa1ebfdad661/
https://www.cnblogs.com/shuiyi/p/5305435.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。