Created
January 16, 2015 20:19
-
-
Save tarkanlar/f5901c5c0d645e2d1ef7 to your computer and use it in GitHub Desktop.
lodash pluck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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