1.0.0 • Published 9 years ago

array-pluck v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

array-pluck Build Status

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.