Reduces collection to a value which is the accumulated result of running
each element in collection thru iteratee, where each successive
invocation is supplied the return value of the previous. If accumulator
is not given, the first element of collection is used as the initial
value. The iteratee is invoked with four arguments:
(accumulator, value, index|key, collection).
Many lodash methods are guarded to work as iteratees for methods like
reduce, reduceRight, and transform.
The guarded methods are:
assign, defaults, defaultsDeep, includes, merge, orderBy,
and sortBy
Reduces
collection
to a value which is the accumulated result of running each element incollection
thruiteratee
, where each successive invocation is supplied the return value of the previous. Ifaccumulator
is not given, the first element ofcollection
is used as the initial value. The iteratee is invoked with four arguments: (accumulator, value, index|key, collection).Many lodash methods are guarded to work as iteratees for methods like
reduce
,reduceRight
, andtransform
.The guarded methods are:
assign
,defaults
,defaultsDeep
,includes
,merge
,orderBy
, andsortBy