Skip to content

Instantly share code, notes, and snippets.

@tarkanlar
Created January 16, 2015 20:19
Show Gist options
  • Save tarkanlar/f5901c5c0d645e2d1ef7 to your computer and use it in GitHub Desktop.
Save tarkanlar/f5901c5c0d645e2d1ef7 to your computer and use it in GitHub Desktop.
lodash pluck
var drinks = [
{ 'name': 'Coke', 'quantity': 2 },
{ 'name': 'Red Bull', 'quantity': 6 }
];
var currentDrinks = _.pluck(drinks, 'name');
console.log(currentDrinks);
// → [‘Coke’, ‘Red Bull’]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment