Created
May 2, 2014 15:38
-
-
Save navarroaxel/9b4b2a6ec515c39abc1d to your computer and use it in GitHub Desktop.
Example of pluck using UnderscoreJS
This file contains hidden or 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 stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}]; | |
var names = _.pluck(stooges, 'name'); | |
// names => ["moe", "larry", "curly"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment