how to remove second square brackets in an array

The solution for “how to remove second square brackets in an array” can be found here. The following code will assist you in solving the problem.

const data = [
[
{id: 1},
{id: 2}
],
[
{id: 3},
{id: 4}
]
];

const newData = [].concat(…data);
console.log(newData);

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in