3 ms·
In many cases the function passed in will not make any sense outside of the context in which it is used. For example, consider: const kittenNames = cats.fla
by jhomedall 9y ago
In many cases the function passed in will not make any sense outside of the context in which it is used.
For example, consider:
const kittenNames = cats.flatMap(cat => cat.kittens)
.map(kitten => kitten.name);
In this case, what would be gained by extracting the two inline functions?