---
description: https://stackoverflow.com/questions/10865025/merge-flatten-an-array-of-arrays
---

# Flatten an array of arrays,merge, làm phẳng một mảng các mảng (ok)

<figure><img src="https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LYjAG13rAPdbArSfRyB%2Fuploads%2FHXSFPc7dzyAhVj6Uav3x%2Fimage.png?alt=media&#x26;token=317a3a46-c1be-4d6f-961d-ce57642dae2e" alt=""><figcaption></figcaption></figure>

```javascript
const arrays = [
      ["$6"],
      ["$12"],
      ["$25"],
      ["$25"],
      ["$18"],
      ["$22"],
      ["$10"]
    ];
const merge3 = arrays.flat(1); //The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
console.log(merge3);
```
