Skip to content

Instantly share code, notes, and snippets.

@redteam-snippets
Created April 10, 2012 19:01
Show Gist options
  • Save redteam-snippets/2353695 to your computer and use it in GitHub Desktop.
Save redteam-snippets/2353695 to your computer and use it in GitHub Desktop.
Javascript: Get JSON Key / Values From Array of JSON Objects
var headers = [
{"Authentication" : "AUTH_KEY"},
{"rememberMe" : true}
];
// ===============================================================
for (var i = 0, j = headers.length; i < j; i = i + 1) {
Object.keys(headers[i]).forEach(function (header) {
console.log(header + ' = ' + headers[i][header]);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment