4 ms·
> using latest language standard(ES6/ES2015), avoiding awkwardnesses from the past > `Object.create` :(
by rco8786 10y ago
> using latest language standard(ES6/ES2015), avoiding awkwardnesses from the past
> `Object.create`
:(
- bpesquet 10y agoCare to elaborate? Understanding prototypal inheritance seems essential to me, and Object.create() is the cleanest way to show it in action. The book also presents the alternative class syntax and numerous ES2015 additions like block-scoped variables and arrow functions, to name a few.
- rco8786 10y agoIt explicitly states it avoids the past and focuses on es2015, but then talks about old patterns.
- bpesquet 10y agoI don't consider Object.create() and factory functions to be "old patterns", but YMMV. How would you teach OOP basics to a JS newcomer then? Using only class without mentioning prototypes?