diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index fb56a0b1e..e95658916 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -397,9 +397,11 @@ result = _.findLast(foodsCombined, 'organic'); result = _.forEach([1, 2, 3], function (num) { console.log(num); }); result = <_.Dictionary>_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); }); +result = _.forEach({ name: 'apple', type: 'fruit' }, function (value, key) { console.log(value, key) }); result = _.each([1, 2, 3], function (num) { console.log(num); }); result = <_.Dictionary>_.each({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); }); +result = _.each({ name: 'apple', type: 'fruit' }, function (value, key) { console.log(value, key) }); result = <_.LoDashArrayWrapper>_([1, 2, 3]).forEach(function (num) { console.log(num); }); result = <_.LoDashObjectWrapper<_.Dictionary>>_(<{ [index: string]: number; }>{ 'one': 1, 'two': 2, 'three': 3 }).forEach(function (num) { console.log(num); }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 482742bed..ff8502c16 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2939,6 +2939,14 @@ declare module _ { callback: ObjectIterator, thisArg?: any): Dictionary; + /** + * @see _.each + **/ + forEach( + object: T, + callback: ObjectIterator, + thisArg?: any): T + /** * @see _.forEach **/ @@ -2965,6 +2973,14 @@ declare module _ { object: Dictionary, callback: ObjectIterator, thisArg?: any): Dictionary; + + /** + * @see _.each + **/ + each( + object: T, + callback: ObjectIterator, + thisArg?: any): T } interface LoDashArrayWrapper {