> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/javascript/flatten-an-array-of-arrays-merge-lam-phang-mot-mang-cac-mang-ok.md).

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

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

<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&amp;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);
```
