6 ms·
I almost always want event listeners to have `this` refer to the element on which they were added, not the class from which they came. It's the default case for
by moron4hire 9y ago
I almost always want event listeners to have `this` refer to the element on which they were added, not the class from which they came. It's the default case for all but arrow functions, so it takes no extra effort in most cases, and if I really need other state, I find it is clearer if it comes through a closure. Plus, making it a habit makes it easier to keep it straight.
- k__ 9y agoI found this only to be a problem in legacy libraries.