thru source
_.thru(value, interceptor)
This method is like _.tap
except that it returns the result of interceptor
.
Arguments
- value (*)
The value to provide to
interceptor
. - interceptor (Function)
The function to invoke.
Returns (*)
Returns the result of interceptor
.
Example
_(' abc ')
.chain()
.trim()
.thru(function(value) {
return [value];
})
.value();
// => ['abc']