I am using forEach to loop through a an array of objects. In the last one ("trans") I want to create a nested array of objects, just like my database:
But I have got an error in my code:
snap.forEach(childSnapshot => {
allWorks.push({
id: childSnapshot.key,
link: childSnapshot.val().link,
trans: childSnapshot.child('trans').map(childSnapshot => { lang: childSnapshot.key}) // <- error: childSnapshot.child(...).map is not a function
})
})
What am I doing wrong?
THANKS
