_(...).find

This commit is contained in:
motemen
2014-10-18 18:08:20 +09:00
parent 824029abf4
commit 2507e73a5f
2 changed files with 27 additions and 0 deletions
+5
View File
@@ -383,6 +383,11 @@ result = <number>_.find([1, 2, 3, 4], function (num) {
});
result = <IFoodCombined>_.find(foodsCombined, { 'type': 'vegetable' });
result = <IFoodCombined>_.find(foodsCombined, 'organic');
result = <number>_([1, 2, 3, 4]).find(function (num) {
return num % 2 == 0;
});
result = <IFoodCombined>_(foodsCombined).find({ 'type': 'vegetable' });
result = <IFoodCombined>_(foodsCombined).find('organic');
result = <number>_.detect([1, 2, 3, 4], function (num) {
return num % 2 == 0;
+22
View File
@@ -2872,6 +2872,28 @@ declare module _ {
pluckValue: string): T;
}
interface LoDashArrayWrapper<T> {
/**
* @see _.find
*/
find(
callback: ListIterator<T, boolean>,
thisArg?: any): T;
/**
* @see _.find
* @param _.where style callback
*/
find<W>(
whereValue: W): T;
/**
* @see _.find
* @param _.where style callback
*/
find(
pluckValue: string): T;
}
//_.findLast
interface LoDashStatic {
/**