Function multiple output

Hello experts

I have the following function

var x = msg.payload
msg2.payload = x,
msg2.topic="auth"
msg1.notify="auth"
return [msg1 , msg2];

I have 2 outputs, but I am getting an error for msg2
"ReferenceError: msg2 is not defined (line 2, col 1)"
I have followed the steps of lessons, but can not get it to work.
What am I missing

Declaration.

var msg1 = {};
var msg2 = {};
//...
//Your code
//...
return [msg1 , msg2];

Thanks Steve,

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