iBoolat,
или obj[item]
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 in obj)
if (typeof obj[item] === "object") {
console.log("Here is an object!");
recursion(obj[item])
} else console.log(obj[item])
}
console.log(typeof obj.c);
recursion(obj);