# Node-red 3.0 problem

**URL:** <https://discourse.nodered.org/t/node-red-3-0-problem/79316>\
**Category:** General\
**Created:** [20 June 2023 11:54 UTC](https://discourse.nodered.org/t/node-red-3-0-problem/79316 "2023-06-20T11:54:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ketpa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ketpa/32/42496_2.png) [@ketpa](https://discourse.nodered.org/u/ketpa)\
**Post date:** [20 June 2023 11:54 UTC](https://discourse.nodered.org/t/node-red-3-0-problem/79316/1 "2023-06-20T11:54:47Z")

</div>

I install node-red v3.0.2 and I haven't javascript function like length ect.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/574e70d584dece0361d0ccf6ec87fb786888f2a2.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [20 June 2023 11:59 UTC](https://discourse.nodered.org/t/node-red-3-0-problem/79316/2 "2023-06-20T11:59:35Z")

</div>

There is no msg.payload, your array is in array (which is a bad name), but you are using length on msg.payload.  
try

```auto
msg.payload = [1,2,3,4,5];
let array_length = msg.payload.length;
msg.payload = "Length: " + array_length;
return msg;

```

---

<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:** [19 August 2023 11:59 UTC](https://discourse.nodered.org/t/node-red-3-0-problem/79316/3 "2023-08-19T11:59:52Z")

</div>

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