var obj = {
innerObj1 : {
name : 'a',
sixe: 1
},
onnerObj2 : {
name: 'b',
size: 2
}
};
function loop (o){
for(var key in o) {
alert(key);
for(var prop in key) {
alert(prop);
}
}
};
loop(obj);
function loop (o){
Object.keys(o).forEach(function (innerObject) {
Object.keys(o[innerObject]).forEach(function (prop) {
console.log(
'Property: ' + prop,
'Value: ' + o[innerObject][prop],
'in Inner Object: ' + innerObject
);
});
});
};