What is the significance of the double brackets for the [[prototype]] property in JavaScript?

后端 未结 3 864
梦毁少年i
梦毁少年i 2020-11-28 06:27

I know that every JavaScript object has an internal property called [[Prototype]]. Some implementations allow access to it via a property called __proto__

3条回答
  •  时光说笑
    2020-11-28 06:35

    The reason it's in brackets is to denote that it's a private property. The brackets themselves are never used in code anywhere.

    As you pointed out, some implementation provide access to that private property under __proto__, but it's non-standard.

提交回复
热议问题