[
[ {id: 1}, {id: 2}, {id: 3} ],
[ {id: 1}, {id: 2}, {id: 3} ],
[ {id: 1}, {id: 2}, {id: 3} ]
]
[{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}, {id: 7}, {id: 8}]
renderLists = (list) => {
return list.map(item => {
и вот тут не знаю
}
}
const result = arr.flat().map((n, i) => ({ ...n, id: -~i }));
const result = [];
for (const n of arr) {
for (const m of n) {
result.push({
...m,
id: result.length + 1,
});
}
}