thru

Seq
since 3.0.0

Arguments

  • * The value to provide to `interceptor`.
  • Function The function to invoke.

Returns

* the result of `interceptor`.

This method is like _.tap except that it returns the result of interceptor. The purpose of this method is to "pass thru" values replacing intermediate results in a method chain sequence.

Example of Lodash _.thru

_('  abc  ')
 .chain()
 .trim()
 .thru(function(value) {
   return [value];
 })
 .value();
// => ['abc']