How do I split an array into individual array: [1,2,3,4,5] => [1][2][3][4][5]
The array of objects is gotten from a backend API
const arr = [
{
id: '1',
name: 'Emmanuel',
...
},
{
id: '1',
name: 'Emmanuel',
...
}
]
Doing arr.map(a => a.id)
gave me [1,2,...]
, now how do I get individual array from the ids: [1][2]