How can i iterate through a nested object in a object without creating a function and without using ECMASCRIPT new properties like Object.entries and the like. That including not using JSON. Just Vanilla javascript. Rather with pure .notation or square brackets (i would like to understand how it would work and not just solve my problem). This is my code.
var obj = { name1:{fname:'jack',sname:'smith',age:31},
name2:{fname:'john',sname:'dill',age:55}}
How can i print every key with every value using a for in loop
if i got it correct , is something like this you are looking for?
for(var property in obj) {
for(var property2 in obj[property]) {
console.log('key:' + property2 + ' ' + 'value:' + obj[property][property2]);
}
}