mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Cleanup _.forEach docs. [ci skip]
This commit is contained in:
@@ -4370,8 +4370,8 @@
|
|||||||
* _([1, 2, 3]).forEach(function(n) { console.log(n); }).join(',');
|
* _([1, 2, 3]).forEach(function(n) { console.log(n); }).join(',');
|
||||||
* // => logs each number and returns '1,2,3'
|
* // => logs each number and returns '1,2,3'
|
||||||
*
|
*
|
||||||
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num, key) { console.log(num, key); });
|
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(n, key) { console.log(n, key); });
|
||||||
* // => logs each number-key pair ('1 one') and returns the object (property order is not guaranteed across environments)
|
* // => logs each value-key pair and returns the object (property order is not guaranteed across environments)
|
||||||
*/
|
*/
|
||||||
function forEach(collection, iterator, thisArg) {
|
function forEach(collection, iterator, thisArg) {
|
||||||
return (typeof iterator == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
return (typeof iterator == 'function' && typeof thisArg == 'undefined' && isArray(collection))
|
||||||
|
|||||||
Reference in New Issue
Block a user