mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Tweak _.reduce documentation.
Former-commit-id: 58d8a724dbf53594420e355c3d29ae28b53a7886
This commit is contained in:
@@ -1190,7 +1190,7 @@ _.pluck(stooges, 'name');
|
|||||||
### <a id="_reducecollection--callbackidentity-accumulator-thisarg"></a>`_.reduce(collection [, callback=identity, accumulator, thisArg])`
|
### <a id="_reducecollection--callbackidentity-accumulator-thisarg"></a>`_.reduce(collection [, callback=identity, accumulator, thisArg])`
|
||||||
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2465 "View in source") [Ⓣ][1]
|
<a href="#_reducecollection--callbackidentity-accumulator-thisarg">#</a> [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2465 "View in source") [Ⓣ][1]
|
||||||
|
|
||||||
Boils down a `collection` to a single value. The initial state of the reduction is `accumulator` and each successive step of it should be returned by the `callback`. The `callback` is bound to `thisArg` and invoked with `4` arguments; for arrays they are *(accumulator, value, index|key, collection)*.
|
Reduces a `collection` to a single value. The initial state of the reduction is `accumulator` and each successive step of it should be returned by the `callback`. The `callback` is bound to `thisArg` and invoked with four arguments; for arrays they are *(accumulator, value, index|key, collection)*.
|
||||||
|
|
||||||
#### Aliases
|
#### Aliases
|
||||||
*foldl, inject*
|
*foldl, inject*
|
||||||
|
|||||||
@@ -2443,9 +2443,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boils down a `collection` to a single value. The initial state of the
|
* Reduces a `collection` to a single value. The initial state of the reduction
|
||||||
* reduction is `accumulator` and each successive step of it should be returned
|
* is `accumulator` and each successive step of it should be returned by the
|
||||||
* by the `callback`. The `callback` is bound to `thisArg` and invoked with 4
|
* `callback`. The `callback` is bound to `thisArg` and invoked with four
|
||||||
* arguments; for arrays they are (accumulator, value, index|key, collection).
|
* arguments; for arrays they are (accumulator, value, index|key, collection).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
Reference in New Issue
Block a user