_.over
is a function in lodash that creates a function that applies other functions to a list of arguments, returning an array of the results.
The syntax of _.over
is as follows:
index.tsx20 chars2 lines
Here, iteratees
is an array of functions that should be applied.
Example usage:
index.tsx177 chars7 lines
In the above example, func
is a function created using _.over
and applies the functions multiply
, square
, and double
to the arguments (3, 4)
. As a result, it returns an array [12, 9, 6]
, which are the respective results of each function applied to the arguments.
Note that when using _.over
, the functions are applied in the order they are specified in the iteratees
array.
gistlibby LogSnag