array-pluck

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i array-pluck

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • frozzare