A quick example of a function with a switch statement inside to provide separate outputs...
[{"id":"c474f6e8.3b8b08","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":399,"y":547,"z":"ef78dde5.10872","wires":[["339a460c.cc65ba"]]},{"id":"339a460c.cc65ba","type":"function","name":"function with switch","func":"\nvar day;\nvar m = msg.payload % 5;\nnode.warn(\"number = \" + m);\nswitch (m) {\n case 0:\n return[{payload:0},null,null,null,null];\n case 1:\n return[null,{payload:1},null,null,null];\n case 2:\n return[null,null,{payload:2},null,null];\n case 3:\n return[null,null,null,{payload:3},null];\n case 4:\n return[null,null,null,null,{payload:4}];\n}\n\nreturn null;","outputs":"5","noerr":0,"x":604,"y":546,"z":"ef78dde5.10872","wires":[["9a42f2d8.65bd1"],["7e380634.81c7f8"],["77151e17.88eae"],["1376d06c.ec893"],["c1774d45.3e88b"]]},{"id":"9a42f2d8.65bd1","type":"debug","name":"","active":true,"console":"false","complete":"false","x":852,"y":429,"z":"ef78dde5.10872","wires":[]},{"id":"7e380634.81c7f8","type":"debug","name":"","active":true,"console":"false","complete":"false","x":854,"y":472,"z":"ef78dde5.10872","wires":[]},{"id":"77151e17.88eae","type":"debug","name":"","active":true,"console":"false","complete":"false","x":854,"y":516,"z":"ef78dde5.10872","wires":[]},{"id":"1376d06c.ec893","type":"debug","name":"","active":true,"console":"false","complete":"false","x":854,"y":561,"z":"ef78dde5.10872","wires":[]},{"id":"c1774d45.3e88b","type":"debug","name":"","active":true,"console":"false","complete":"false","x":856,"y":607,"z":"ef78dde5.10872","wires":[]}]