let obj = {
key1: {
key1: 1,
key2: 2,
key3: 3,
},
key2: {
key1: 4,
key2: 5,
key3: 6,
},
key3: {
key1: 7,
key2: 8,
key3: 9,
},
}
let sum = 0;
for (let key1 in obj) {
for (let key2 in obj[key1]) {
for (let key3 in obj[key1][key2]) {
sum += o;
}
}
}
console.log(sum);