0.0.1 • Published 9 years ago

prototype-pluck v0.0.1

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

prototype-pluck

Pluck properties of the arrays

This module was inspired by the pluck method of lodash.

node.js

require('prototype-pluck');

[{name:'Tony'},{name:'Matt'},{name:'Peter'}].pluck('name'); //['Tony', 'Matt', 'Peter']
[1,11,111].pluck('toString', true); //['1','11','111']
['Clint', 'Nick', 'Steve'].pluck('substring', true, 1, 4); //['lin', 'ick', 'tev']

browser

<script src="node_modules/prototype-pluck/min/pluck.js"></script>
<script>
[{name:'Tony'},{name:'Matt'},{name:'Peter'}].pluck('name'); //['Tony', 'Matt', 'Peter']
[1,11,111].pluck('toString', true); //['1','11','111']
['Clint', 'Nick', 'Steve'].pluck('substring', true, 1, 4); //['lin', 'ick', 'tev']
</script>

##TODO

  • Add unit test (QUnit)

License

MIT