Given this simple example:
const testdata = [
{
id: "001",
name: "Bob",
comments: [
{
id: "01",
text: "Hello World"
},
{
id: "02",
text: "Hello Mars"
}
]
}
];
I would like to output all the comments for this object:
With this I get the id and the name
testdata.map(i => { console.log(i.id + i.name)});
What is the best way to output the nested array that holds the comments?