score:3

Accepted answer

You can simply use Array.prototype.flat for that:

console.log([
  [{
    id: 1
  }],
  [{
    id: 2
  }]
].flat());

score:2

One way is:

console.log([[{id: 1}], [{id: 2}]].map(arr => arr[0]))

Another way is Array.prototype.flat():

const arr1 = [[{id: 1}], [{id: 2}]]

console.log(arr1.flat())


Related Query

More Query from same tag