Could you help me to add an element/elements to the array and then display array in the debug window.
I do something wrong!
var array = flow.get('array') || "";
flow.set("array", flow.get("array").push(msg.payload));
return [ msg ];
my flow
[{"id":"8e05673f.25a118","type":"tab","label":"Delay","disabled":false,"info":""},{"id":"e9887f38.771fb","type":"inject","z":"8e05673f.25a118","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":170,"y":200,"wires":[["8f92e447.ec7758"]]},{"id":"8f92e447.ec7758","type":"function","z":"8e05673f.25a118","name":"","func":"var array = flow.get('array') || \"\";\n\nflow.set(\"array\", flow.get(\"array\").push(msg.payload));\nreturn [ msg ];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":240,"wires":[["48b4aadb.221d54","f70ea5c3.3a8408"]]},{"id":"f70ea5c3.3a8408","type":"ui_slider","z":"8e05673f.25a118","name":"Brightness","label":"Яркость","tooltip":"","group":"bf8577b0.734c08","order":2,"width":0,"height":0,"passthru":true,"outs":"end","topic":"brightness","min":"1","max":"254","step":1,"x":690,"y":240,"wires":[[]]},{"id":"48b4aadb.221d54","type":"debug","z":"8e05673f.25a118","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":410,"y":300,"wires":[]},{"id":"fb80fc91.c062f","type":"inject","z":"8e05673f.25a118","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":170,"y":240,"wires":[["8f92e447.ec7758"]]},{"id":"a10f32f8.65f5d","type":"inject","z":"8e05673f.25a118","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":170,"y":280,"wires":[["8f92e447.ec7758"]]},{"id":"db752fb9.2d235","type":"function","z":"8e05673f.25a118","name":"array","func":"var array = [];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":160,"wires":[[]]},{"id":"bf8577b0.734c08","type":"ui_group","name":"test","tab":"96dac147.c7906","order":1,"disp":true,"width":"6","collapse":false},{"id":"96dac147.c7906","type":"ui_tab","name":"Array","icon":"dashboard","order":6,"disabled":false,"hidden":false}]