There are other methods but, to my knowledge, this is the most reliable:
function isArray(what) {
return Object.prototype.toString.call(what) === '[object Array]';
}
So, to apply it to your code:
for(var i in json) {
if(isArray(json[i])) {
// Iterate the array and do stuff
} else {
// Do another thing
}
}