3 ms·
This seems like a very verbose retread. What I was saying is if you are currently using a named function: function foo(bar) { // … } you don’t lose
by minitech 7y ago
This seems like a very verbose retread.
What I was saying is if you are currently using a named function:
function foo(bar) {
// …
}
you don’t lose the name by making it an arrow function:
const foo = bar => {
// …
};
and yes, you can name your callbacks and event handlers like this before passing them to functions. Introducing variables to name values (any values, not just functions) doesn’t really complicate code. Many times, it can be a readability improvement.