# Arr.flat() method

**URL:** <https://discourse.nodered.org/t/arr-flat-method/30764>\
**Category:** Feature Requests\
**Created:** [27 July 2020 11:23 UTC](https://discourse.nodered.org/t/arr-flat-method/30764 "2020-07-27T11:23:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![efratha94](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@efratha94](https://discourse.nodered.org/u/efratha94)\
**Post date:** [27 July 2020 11:23 UTC](https://discourse.nodered.org/t/arr-flat-method/30764/1 "2020-07-27T11:23:09Z")

</div>

Hi,  
After struggling with parsing nested arrays and objects, I thought it would be nice if the JS arr.flat() method could work in Node-Red too.

Thanks,

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [27 July 2020 11:26 UTC](https://discourse.nodered.org/t/arr-flat-method/30764/2 "2020-07-27T11:26:46Z")

</div>

Array.flat was added to `node.js` in version 11. So as long as you're running on that or later (we'd recommend Node 12), then you should be able to Array.flat.

---

<div class="post-metadata">

**Author:** ![efratha94](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@efratha94](https://discourse.nodered.org/u/efratha94)\
**Post date:** [27 July 2020 11:36 UTC](https://discourse.nodered.org/t/arr-flat-method/30764/3 "2020-07-27T11:36:40Z")

</div>

Thanks! But how can I update it if I'm using Docker & Portainer? Then Node.js, npm & Node-Red are installed inside the docker...  
Node-Red image is set as latest - v1.1.2

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [27 July 2020 11:48 UTC](https://discourse.nodered.org/t/arr-flat-method/30764/4 "2020-07-27T11:48:20Z")

</div>

The default docker image is Node 10 based. If you want a 12 based image, you'd use `nodered/node-red:latest-12`.

---

<div class="post-metadata">

**Author:** ![efratha94](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@efratha94](https://discourse.nodered.org/u/efratha94)\
**Post date:** [27 July 2020 12:00 UTC](https://discourse.nodered.org/t/arr-flat-method/30764/5 "2020-07-27T12:00:40Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 September 2020 12:00 UTC](https://discourse.nodered.org/t/arr-flat-method/30764/6 "2020-09-25T12:00:45Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
