array-pluck
v1.0.0
Published
Extract a list of property values from array with objects
Downloads
3
Readme
array-pluck
Extract a list of property values from array with objects
Install the module with: npm install array-pluck
Example
var peoples = [
{ name: 'Fredrik', age: 22, favorites: { fruit: 'Pineapple' } },
{ name: 'Elli', age: 22, favorites: { fruit: 'Apple' } }
]
, result = arrayPluck(peoples, 'favorites.fruit');
console.log(result); // ['Pineapple', 'Apple']
License
Copyright (c) 2014 Fredrik Forsmo
Licensed under the MIT license.