3 ms·
It has one important downside tho - because you can't chain calls, your code ends up much less readable: It needs to be read from the inside-out, and the functi
by nadaviv 14y ago
It has one important downside tho - because you can't chain calls, your code ends up much less readable: It needs to be read from the inside-out, and the functions you're applying on the array are in reverse order compared to the order of execution. Its also harder to to see which arguments go to which function.
Compare
_(array).map(func).filter(func).reduce(func)
and:
_.reduce(_.filter(_.map(array, func), func), func)