This little beastie here is tap. A really useful function for quick-debugging chains of function calls, anonymous functions and, actually, whatever you just want to print.
Why would you use instead of good old
console.log? Let me show you an example:
Now, suppose you’re getting nothing from this chain (possibly an error). Where is it failing? Maybe
bank_info isn’t returning anything, so we’ll tap it:
Depending on our particular implementation, it might print something or not. I’ll assume the information that we got from our tapping was correct and therefore, bank_info isn’t causing anything.
We must then move on to the next chain, filter.
... read the whole story at www.jstips.co.