According to Regg "Raganwald" Braithwaite,
tap is a traditional name borrowed from various Unix shell commands. It takes a value and returns a function that always returns a value, but if you pass it a function, it performs a function for side effects. [a source]
This begs the same question as with underscore.js.
The bottom line is this: all clicks are the return of the object that it passed. However, if a function is passed to it, it will perform that function. Thus, it is useful for debugging or for performing side effects in an existing chain without changing this chain.
danyamachine
source share