2 ms·
It's all context dependent of course but in this example the original example is far more readable. Sometimes more abstractions make it harder to understand how
by lawn 6y ago
It's all context dependent of course but in this example the original example is far more readable. Sometimes more abstractions make it harder to understand how everything fits together.
If you really want to document it more wrap the map/filter inside a single function, assign it to an aptly named variable or add a comment above.
You also introduce a refactoring problem when you split it out in functions as you now need to consider that it may be called in other places too.