Skip to content

TypeScript code snippet – How to remove second square brackets in an array?

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

const newData = [].concat(...data);
console.log(newData);
See also  Python code snippet - How to change help command on discord ?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.