Here's one way of doing it.
// First, let's have some variables and your example object/json:
var i, l, key, item = [ {keyOne: 10}, {keyTwo: 'string', keyThree: false} ];
// The example you provided is an array, so we first loop that array of objects/json objects
for (i = 0, l = item.length; i < l; i++) {
// Now, let's see all the keys in the current object
console.log('Iterating array ' + (i + 1));
for (key in item[i]) {
console.log(key);
}
}
When I run this in node v0.6.11, I get this:
node
> // First, let's have some variables and your example object/json:
undefined
> var i, l, key, item = [ {keyOne: 10}, {keyTwo: 'string', keyThree: false} ];
undefined
> // The example you provided is an array, so we first loop that array of objects/json objects
undefined
> for (i = 0, l = item.length; i < l; i++) {
... // Now, let's see all the keys in the current object
... console.log('Iterating array ' + (i + 1));
... for (key in item[i]) {
..... console.log(key);
..... }
... }
Iterating array 1
keyOne
Iterating array 2
keyTwo
keyThree
undefined
>