Skip to content

Poop Code

  • Home
  • Linux

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

October 29, 2024 by poopcode
const data = [
  [
    {id: 1},
    {id: 2}
  ],
  [
    {id: 3},
    {id: 4}
  ]
];

const newData = [].concat(...data);
console.log(newData);
Categories Linux
Pass arguments to your node.js app from pm2
Arrays – DS – Hackerrank Challenge – Java Solution
© 2025 Poop Code • Built with GeneratePress