Skip to content

frozzare/array-pluck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

array-pluck Build Status

Extract a list of property values from array with objects

Install the module with: npm install array-pluck

Example

var arrayPluck = require('array-pluck');

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

MIT © Fredrik Forsmo

About

Extract a list of property values from array with objects

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published