4 ms·
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...], ob
by nemothekid 12y 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.
- raziel2p 12y agoFeels like yesterday I was told Object.create was the new best way to do this.
- jsnoble 12y agoThe 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