# Anyone know how to join two arrays together?

**URL:** <https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660>\
**Category:** Arcade\
**Created:** [January 29, 2023, 11:56pm UTC](https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660 "2023-01-29T23:56:20Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [February 2, 2023, 8:05pm UTC](https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660/21 "2023-02-02T20:05:47Z")

</div>

Woah thats AWESOME!! Thanks so much!!

---

<div class="post-metadata">

**Author:** ![Reflectfr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/reflectfr/32/32515_2.png) [@Reflectfr](https://forum.makecode.com/u/Reflectfr)\
**Post date:** [February 3, 2023, 7:16pm UTC](https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660/22 "2023-02-03T19:16:19Z")

</div>

makecode!!! Ur very cool

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [February 6, 2023, 6:45am UTC](https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660/23 "2023-02-06T06:45:40Z")

</div>

Update: I merged this extension with my [Sorting extension](https://forum.makecode.com/t/sorting-algorithm-extension-for-blocks/16260) to create the array-methods extension. I might update it sometime in the future.

> **[GitHub - S0m3randomguy/array-methods: A MakeCode project](https://github.com/s0m3randomguy/array-methods/)**
>
> A MakeCode project. Contribute to S0m3randomguy/array-methods development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [February 24, 2023, 6:02pm UTC](https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660/24 "2023-02-24T18:02:00Z")

</div>

Important correction!  
In the second image, the `if length of array items <= 1` block is incorrect.  
It should instead be swapped with

```auto
if length of array items < 1 do
    return [] (empty array)

```

In the old code, if the length of array is 1 (ex. [[1, 2, 3] ], array contains one subarray), it would just return that sequence which would not be concatenated. Sorry for my error, I didn’t catch it before

[Previous page](https://forum.makecode.com/t/anyone-know-how-to-join-two-arrays-together/17660.md?page=1)
