I have this simple JSON object:
var data = [{"some":25},{"stuff":12}]
I want to loop through this object to access both the key and it's value in each pair. Currently I know how to loop when a fixed key like:
var data = [{"host":"foo","url":"bar"},{"host":"foos","url":"bars"}]
$.each(data, function(i, item) {
alert(data[i].host);
});
What about if the key is different and I need to access it as well as the value?