How can I iterate over the Properties of an object and its childs objects? I used for in but I can't get the Songs info :/
let discos = [];
let disco1 = {
discoName: 'name disco1',
band: 'band name',
code: 1,
songs: [
{ 'songName': 'Song Name',
'duration': 200,
},
],
};
let disco2 = {
discoName: 'name disco 2',
band: 'band name 2',
code: 1,
songs: [
{ 'songName': 'Song Name 0',
'duration': 200,
},
],
};
discos.push(disco1,disco2);
for (let disco in discos){
console.log(discos[disco].discoName);
}