Hi everyone,
it's been all morning I try to order my array by col1 asc, without success obviously ...
This is my array, can you help me?
Function node:
msg.payload = msg.payload.sort((a, b) => a.coll - b.coll)
return msg
Thank you, thank you very much ......
FYI, the sort function actually mutates the source array so setting msg.payload
is not really necessary
i.e.
msg.payload.sort((a, b) => a.coll - b.coll)
return msg
is all that is really required however I always put the assignment there for clarity.
Ok, I understand ...