# How can I get array components values

**URL:** https://discourse.nodered.org/t/how-can-i-get-array-components-values/4820
**Category:** General
**Created:** [12 November 2018 22:01 UTC](https://discourse.nodered.org/t/how-can-i-get-array-components-values/4820 "2018-11-12T22:01:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [13 November 2018 07:49 UTC](https://discourse.nodered.org/t/how-can-i-get-array-components-values/4820/2 "2018-11-13T07:49:30Z")

</div>

Note that this is not an Array it is a Buffer, which is not the same thing. However, if you just want individual bytes as numbers then you can access as if it is an array of 8 bit integers. So you can use, for example  
`var x = msg.payload[2]`  
to get element 2. There are a number of questions though. Is that what you are trying to do or do you want the buffer split into a sequence of messages each containing one value or what?

If you want one number per message then first convert it to an explicit array using

```auto
msg.payload = [...msg.payload]
return msg

```

then feed it into a Split node and it will give you a sequence of messages, each with one number.

---

_[View the full topic](https://discourse.nodered.org/t/how-can-i-get-array-components-values/4820)._
