const events = [
[{
createdAt: "2021-12-06T16:32:59.260Z"
location: "Off-Site"
name: "Viewing"
}],
[{
createdAt: "2021-12-06T16:32:59.260Z"
... }],
..........
]
Hi I have question. From the above can i be able to convert the data to somethin like
const events = [
{
createdAt: "2021-12-06T16:32:59.260Z"
location: "Off-Site"
},
{
createdAt: "2021-12-06T16:32:59.260Z"
... },
..........
]
if anyone knows please answer
Use Array.flat method
The flat() method creates a new array with all sub-array elements concatenated into it recursively up to the specified dept
const arr = [[1,2,3],[4,5]];
const res = arr.flat()
console.log(res)