DEV Community

Discussion on: 5 Ways to Write Functions in JavaScript

Collapse
 
anubarak profile image
Robin Schambach

"Avoid using arrow functions for event handlers"
Why that? I do that quite often, that's one big advantage of Es6 to use arrow functions for event handlers

Collapse
 
robertomaurizzi profile image
Roberto Maurizzi

He said "that use the arguments" object. It's not defined for arrow functions. Also, they don't have their own this but keep the one from their parent function, something that in certain cases is very useful.