Let's say I have an Object-
var obj = {
name : 'John',
contact : {
address : 'xyz',
phone : 555
}
}
Now when I loop through this object
for (let key in obj) {
console.log(typeof key);
}
In Both cases I get type of 'string'. So is there any way to get contact value as an object?