Functional helper for getting property on object.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
README.md
index.js
package.json

README.md

prop

var prop = require( 'func-prop' )

var fighters = [
  {name: 'Evander'},
  {name: 'Muhammed'},
  {name: 'Mike'}
]

fighters.map( prop('name') ) 
//-> ['Evander', 'Muhammed', 'Mike']

prop.backbone

Allso works with backbone style model objects that has the method get

var prop = require( 'func-prop' ).backbone

var fighters = new FightersCollection()
figthers.reset( fighters )

fighters.map( prop('name') )
//-> ['Evander', 'Muhammed', 'Mike']