Created
October 7, 2013 19:09
-
-
Save jimkang/6873224 to your computer and use it in GitHub Desktop.
A simple pluck function, like _.pluck from Underscore.js.
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
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