__proto__ VS. prototype in JavaScript

后端 未结 30 1940
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-21 06:14

This figure again shows that every object has a prototype. Constructor function Foo also has its own __proto__ which is Function.prototype, a

30条回答
  •  忘了有多久
    2020-11-21 06:56

    A nice way to think of it is...

    prototype is used by constructor() functions. It should've really been called something like, "prototypeToInstall", since that's what it is.

    and __proto__ is that "installed prototype" on an object (that was created/installed upon the object from said constructor() function)

提交回复
热议问题