Open gaand opened 7 years ago
I'm OK with this. Any reason to favor function () {}
over () => { }
(with explicit block)?
Cognitive load, in part. If fat arrows are for anonymous single expression functions (mostly) and keyword functions are for everything else, less to remember.
Also, event handlers only get the correct this if you use function
(unless you're doing more sophisticated stuff that can make use of lexical binding and only dealing with the event object to reference the DOM).
Avoid oneliner arrow functions and the time and confusion that result?
so replace
with