Skip to content

Instantly share code, notes, and snippets.

@jimkang
Created October 7, 2013 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimkang/6873224 to your computer and use it in GitHub Desktop.
Save jimkang/6873224 to your computer and use it in GitHub Desktop.
A simple pluck function, like _.pluck from Underscore.js.
function pluck(array, property) {
var plucked = [];
for (var i = 0; i < array.length; ++i) {
plucked.push(array[i][property]);
}
return plucked;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment