and the test 
```
var x = [ {value:123},{value:456}]; 
_.pluck(x,'value')
```
returns [123, 456]
This commit is contained in:
basarat
2013-08-07 10:27:50 +10:00
parent 09be3956b6
commit 13f2ff5f3f

View File

@@ -368,11 +368,11 @@ declare module _ {
* property values.
* @param list The list to pluck elements out of that have the property `propertyName`.
* @param propertyName The property to look for on each element within `list`.
* @return The list of elements within `list` that have the property `propertyName`.
* @return The list of values for `propertyName` for each element within `list`
**/
export function pluck<T extends {}>(
list: Collection<T>,
propertyName: string): T[];
propertyName: string): any[];
/**
* Returns the maximum value in list.
@@ -2852,4 +2852,4 @@ interface _Chain<T> {
declare module "underscore" {
export = _;
}
}