I have a structure like
const test = [
{
items: [
{
id: "tete",
},
{
id: "tete",
},
],
},
{
items: [
{
id: "tete",
},
],
},
];
How go i get all the 'id' value from these array using javascript.
reduceandmap, such as:const ids = test.reduce((a, b) => [...a, ...b.items.map(c => c.id)], []). you can look at the documentation for these functions on the MDN reduce and map