Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are javascript property names like "__proto__" not standardized in ES5/6?

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?

like image 282
Hind Forsum Avatar asked Aug 09 '16 09:08

Hind Forsum


1 Answers

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!

like image 66
Bergi Avatar answered Oct 17 '22 19:10

Bergi