4 ms·
"Just like it's better to understand how prototypal inheritance works in JS BEFORE even using a single class declaration. " About that, does JS class inheritan
by hutzlibu 6y ago
"Just like it's better to understand how prototypal inheritance works in JS BEFORE even using a single class declaration. "
About that, does JS class inheritance now work like classes in java for example? Or is it still just syntactic sugar for the prototype inheritance? By your wording, I assume the later?
- deleted 6y ago[deleted]
- wa1987 6y agoWell, it's complicated :-) https://stackoverflow.com/questions/36419713/are-es6-classes-just-syntactic-sugar-for-the-prototypal-pattern-in-javascript https://stackoverflow.com/questions/36419713/are-es6-classes...
- hutzlibu 6y agoWow. I was hoping, at some point things would improve a bit.
- wa1987 6y agoAgreed. I find myself using a pretty small subset of the language which definitely doesn't include the class keyword. Doubt I'll ever find it useful.
- hutzlibu 6y agoYeah, like many people, I ended up making my own inheritance routines. Then when class came out, I was half rejoicing, half regretting to put up the work. But well, no thanks. I rather keep using my own far from perfect way of things.
- ragnese 6y agoCorrect. It's still prototype based. Thus making the class keyword actually MORE confusing for people from other languages, IMO.