Hacker News new | ask | show | jobs
by nemothekid 4134 days ago
I think assign should be replaced by having a native class in ES6. I've thought of it like

assign(some newly allocated object, base class [, base class...], object with methods).

It seems to get around the funny stuff with new, prototypes and references.

1 comments

Feels like yesterday I was told Object.create was the new best way to do this.
The class in ES6 is just syntactic sugar over Object.create. Class is only coming out becuase most people wont learn that javascript has prototypal inheritance, and how to use it. Its a different mental model, in my opinion prototypal inheritance is more expressive and light weight than typical classes from other languages