---
title: "Discussion on \"What Actually Happens When You Flatten a Nested Array?\" | Hashnode"
description: "Discussion on \"What Actually Happens When You Flatten a Nested Array?\". Yes, JavaScript already gives us flat(). I'm not here to teach you that the method exists. I'm going to dig into what flattening actually means, how depth works, and what happens conceptually when you"
url: "https://hashnode.com/posts/what-actually-happens-when-you-flatten-a-nested-array/6abd25696b3808f77c2b6a36"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What Actually Happens When You Flatten a Nested Array?](https://asgharalifs.hashnode.dev/what-actually-happens-when-you-flatten-a-nested-array?utm_source=hashnode&utm_medium=feed)

Yes, JavaScript already gives us flat(). I'm not here to teach you that the method exists. I'm going to dig into what flattening actually means, how depth works, and what happens conceptually when you

Sep 30 · 8 min read · asgharalifs.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#chaicode](https://hashnode.com/tag/chaicode)
-   [#arrays](https://hashnode.com/tag/arrays)
-   [#array-flatten-in-javascript](https://hashnode.com/tag/array-flatten-in-javascript)
-   [#asgharalifs](https://hashnode.com/tag/asgharalifs)

## Written by

[Asghar ali](https://hashnode.com/@asgharalifs)

@asgharalifs

  
[View profile](https://hashnode.com/@asgharalifs)

Full stack dev

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
