5

There're some properties in js starts/ends with double underscores like __proto__. But I know it equals to constructor.prototype, right? I wish to know whether ES5/ES6 standard included these xxx_ property names, or they're just implementation specific keywords, might have different behavior in different implementations?

Plus: where can I check if a keyword is part of ES standard?

Machavity
  • 30,841
  • 27
  • 92
  • 100
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119
  • 2
    It's not equal to `prototype`. `__proto__` contains reference to object prototype. `prototype` contains object that will be prototype of instances which this constructor creates. Constructor itself has different prototype (you can check constructor's `__proto__` for this) – Maxx Aug 09 '16 at 09:54

1 Answers1

4

I know it equals to constructor.prototype, right?

No.

I wish to know whether ES5/ES6 standard included these __xxx__ property names, or they're just implementation specific keywords, might have different behavior in different implementations?

You can find an overview in the MDN documentation, there are __count__, __noSuchMethod__, __parent__, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__, and __lookupSetter__; and all of them are deprecated. Other implementations than Gecko might have featured more.

Only the getter/setter methods and __proto__ were common amongst implementations, and only __proto__ got into the compatibilty section of the ES6 standard.

where can I check if a keyword is part of ES stardard, any recommended web-sites?

Just read the standards themselves!

Community
  • 1
  • 1
Bergi
  • 630,263
  • 148
  • 957
  • 1,375