4 ms·
Unlike JavaScript, which only has, uh, three (functions, arrow functions, and methods).
by djur 3y ago
Unlike JavaScript, which only has, uh, three (functions, arrow functions, and methods).
- throwanem 3y agoNo, Javascript has functions. That arrow functions handle the "this" binding specially I'll grant as a potential design error, and certainly as a complication; to reiterate, I have not said Javascript is perfect. But classes and methods are sugar over prototype-based objects from 1995, which you are still perfectly free to write if you like.
- masklinn 3y ago> That arrow functions handle the "this" binding specially It’s more the opposite, arrow functions treat `this` as a regular lexical variable, it’s normal functions which special-case `this`.