diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index bb4f464a76..28a6c1ebe0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -400,6 +400,12 @@ result = _.findLast([1, 2, 3, 4], function (num) { result = _.findLast(foodsCombined, { 'type': 'vegetable' }); result = _.findLast(foodsCombined, 'organic'); +result = _([1, 2, 3, 4]).findLast(function (num) { + return num % 2 == 0; +}); +result = _(foodsCombined).findLast({ 'type': 'vegetable' }); +result = _(foodsCombined).findLast('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) }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 3e3fd43d79..e3b73adaac 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2940,6 +2940,28 @@ declare module _ { pluckValue: string): T; } + interface LoDashArrayWrapper { + /** + * @see _.findLast + */ + findLast( + callback: ListIterator, + thisArg?: any): T; + /** + * @see _.findLast + * @param _.where style callback + */ + findLast( + whereValue: W): T; + + /** + * @see _.findLast + * @param _.where style callback + */ + findLast( + pluckValue: string): T; + } + //_.forEach interface LoDashStatic { /**