iBoolat,
var obj = {
a: 3,
b: 2,
c: {
d: 1,
e: 2,
f: {
g: 1,
h: 2
}
},
i: {
j: 1,
k: 1
},
l: 1,
m: {
n: 1,
o: 2,
p: 3,
r: {
s: 1,
t: 2
},
u: 1
},
v: 1,
w: 1,
x: {
y: {
z: 1
}
}
};
function recursion(obj) {
for (var item of Object.values(obj))
if (typeof item === "object") {
console.log("Here is an object!");
recursion(item)
} else console.log(item)
}
console.log(typeof obj.c);
recursion(obj);