const data = {
a1: {
b1: {
value: 1
},
b2: {
value: -5
}
},
a2: {
b3: {
value: 12
},
b4: {
value: 13
}
}
}
for (let input_objects in data) {
for (let key in input_objects) {
if (this.value > 0) {
console.log (this);
}
}
}
for (let key_a in data) {
let input_object = data[key_a];
for (let key_b in input_object) {
let obj_b = input_object[key_b];
if (obj_b.value > 0) {
console.log(obj_b);
}
}
}