3 ms·
That’s a weird choice. Arrow functions in JS don’t redefine ‘this’ like regular functions, so if you don’t use them, you waste time working around the redefinit
by earthboundkid 7y ago
That’s a weird choice. Arrow functions in JS don’t redefine ‘this’ like regular functions, so if you don’t use them, you waste time working around the redefinition.
- hombre_fatal 7y agoAlso, if you default to `() => ...` for anonymous functions, then you can reserve anonymous `function() { ... }` for the rare times you actually want peculiar `this`. Same reason it's nice to default to `const` so that `let` becomes a signal for the bonus feature of reassignment.
- earthboundkid 7y agoNo, const inside of a function is a complete waste of time. There has never been a bug that would be prevented by const inside a function.
- johnchristopher 7y ago> Same reason it's nice to default to `const` so that `let` becomes a signal for the bonus feature of reassignment. Code documentation should be clear and concise, not to be deciphered through the code author's take on the meta meaning of reserved words.