Created
January 17, 2013 12:27
-
-
Save ourmaninamsterdam/4555610 to your computer and use it in GitHub Desktop.
Returns an array of values from a JSON array
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
/** | |
* get_keys() | |
* @param {Array} data JSON array | |
* @param {String} label Value to return | |
* @return {Array} array of matched property | |
*/ | |
function get_keys(data, label) { | |
var key, values = []; | |
for(key in data){ | |
values.push(data[key][label]); | |
} | |
return values; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment