_.flow

_.flow([funcs])

Creates a function that returns the result of invoking the given functions with the this binding of the created function, where each successive invocation is supplied the return value of the previous.

Since

3.0.0

Arguments

  1. [funcs] (...(Function|Function[])): The functions to invoke.

Returns

(Function): Returns the new composite function.

Example

function square(n) {
  return n * n;
}
 

var addSquare = _.flow([_.add, square]);

addSquare(1, 2);
// => 9
doc_Lodash
2016-11-27 16:37:12
Comments
Leave a Comment

Please login to continue.