0

I try to concat Array of multiple Arrays like this

`let soldNumber = [
 [1,2],
 [5,7],
 [35,67],
 ...
]`

to recieve this let soldNumber = [1,2,5,7,35,67,...]

  • 1
    `soldNumber.flat()` – iAmOren Sep 15 '20 at 08:57
  • Please visit the [help], take the [tour] to see what and [ask]. ***[Do some research](https://www.google.com/search?q=concat+multiple+arrays+javascript+site:stackoverflow.com)***, search for related topics on SO; if you get stuck, post a [mcve] of your attempt, noting input and expected output using the `[<>]` snippet editor. – mplungjan Sep 15 '20 at 09:00

2 Answers2

0

soldNumber.flat()

Array.prototype.flat()

iAmOren
  • 2,760
  • 2
  • 11
  • 23
-1
   let soldNumber = [[1,2], [5,7], [35,67]];
   let newSoldNumber = soldNumber.flat();
tatka
  • 301
  • 1
  • 3
  • 9
  • While this may solve the OP's problem, please explain your answer so as to help others too.. – Lal Sep 15 '20 at 10:51