How to split an array without split node

I want to know how can I split an array without having to use the split node. I want to do it in the javascript file of my custom node.Thanks

An array is already split kinda.

Is your question "I want to send a msg for each element of an array"?

Yeah.Exactly that!

loop the array, make a msg object, send it...

for (let i = 0; i < arr.length; i++) {
   var m = { payload: arr[i] };
   node.send(m); //or send(m)
}

Thank you.

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