3 ms·
No problem. A good exercise I used to do was writing inheritence patterns first with pre-ES6 syntax, then constructors, then classes. They are, of course, inter
by porphyrogene 8y ago
No problem. A good exercise I used to do was writing inheritence patterns first with pre-ES6 syntax, then constructors, then classes. They are, of course, interchangeable but it’s not wise to rehearse an anti-pattern.
EDIT: I said assign method earlier, I meant create. The assign method is the pre-ES6 way of creating object instances. Object.create() is used to inherit prototypes. That’s such a common mix-up that I’m embarrassed I didn’t catch it.
- erikpukinskis 8y agoI just don’t use ES6. It’s amazing. I have such a smaller language surface, and so much more predictable and debuggable code. Not a popular approach though. (Of course I can and do use ES6 when coding for other people, I write to whatever standard is established in a codebase.)