4 ms·
What? Anonymous functions are amazing for: * Iterators (map, reduce, filter) * Callbacks (ui actions) * Threads/async tasks The reason I don't name them isn't
by zacmps 3y ago
What?
Anonymous functions are amazing for:
* Iterators (map, reduce, filter)
* Callbacks (ui actions)
* Threads/async tasks
The reason I don't name them isn't because I can't think of a name, it's because:
* There's no point, they'll only be referred to once
* Introducing a separate function block breaks the flow of the code and makes it harder to read (especially for iterators!)