func-prop

Functional helper for getting a prop on an object, sync and async

npm install func-prop
1 downloads in the last week
5 downloads in the last month

prop


var prop = require( 'func-prop' )

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

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

invoke.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']
npm loves you