tap_.tap(object, interceptor)
Invokes interceptor with the object, and then returns object. The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
1 2 3 4 5 6 7 | _.chain([1,2,3,200]) .filter( function (num) { return num % 2 == 0; }) .tap(alert) .map( function (num) { return num * num }) .value(); => // [2, 200] (alerted) => [4, 40000] |
Please login to continue.