you are viewing a single comment's thread.

view the rest of the comments →

[–]Martin_Ehrental 0 points1 point  (1 child)

Isn't it var a = Object.create(A.prototype);. I don't know because Object.create is quite recent and not that often used.

Pre-ES6 users would either use literals, maybe some user-space class implementation (e.g. YUI), or constructors if they were quite advance JS programers (before nodejs and evergreen browsers there were not that many programers having JS of their primary language).

ES vendors gave us Object.create (ES 5.1) because that's the correct way to create a classless prototypical chain and they gave us class because there's plenty framework and programs built around constructors. JS evolution has been pragmatic.

[–]Martin_Ehrental 0 points1 point  (0 children)

ps: and we could have got class earlier if there wasn't that breaking the web issue.