美文网首页
prototype和__proto__

prototype和__proto__

作者: color_小浣熊 | 来源:发表于2019-01-09 16:04 被阅读8次
  • prototype:每个对象都有prototype
  • __ proto __:对象实例的指针
    任何对象的prototype属性对应该对象实例的proto
var obj={}
console.log(obj.__proto__==Object.prototype)true
var arr = []
console.log(arr.__proto__==Array.prototype) //true
console.log(arr.__proto__.__proto__==Object.prototype)//true
console.log(Array.prototype.__proto__==Object.prototype)//true

相关文章

  • 前端

    * __proto__和prototype 每个对象都有__proto__,但只有函数有prototype。当你创...

  • javascript 原型链图

    __proto__和 prototype __proto__是对象才有的属性prototype 是函数才有的属性

  • 彻底明白__proto__和prototype

    主题: # __proto__的由来 # prototype的由来 # __proto__和Prototyp...

  • 2018-01-29 原型链理解

    普通对象和函数对象概念 prototype继承 __proto__、prototype、constructor讲解

  • 隐式原型<画图>

    prototype === __proto__ Function.prototype === Function._...

  • Prototype和__proto__

    1, 只有函数有prototype这个属性.属性值是 一个有constructor属性的对象. 2 new 通过n...

  • __proto__和prototype

    分析 方法(Function)是对象,方法的原型(Function.prototype)是对象。因此,它们都会具有...

  • prototype和__proto__

    prototype两种使用方法 prototype和proto 对象的原型属性(proto)指向构造函数的原型(p...

  • __proto__和prototype

    此图完美诠释了__proto__与prototype的关系...逃!!!

  • __proto__和prototype

    1.对象有属性__proto__,指向该对象的构造函数的prototype.2.方法除了有属性__proto__,...

网友评论

      本文标题:prototype和__proto__

      本文链接:https://www.haomeiwen.com/subject/pydgrqtx.html