I am trying to put an "if" in my code. My output[3] is debugging as a string and that is the value of the string. This if is not working to return my output[2]. Any suggestions?
var lines = msg.payload.split("~~");
var output = [];
output[0] = {payload:lines[0]};
output[1] = {payload:lines[1]};
output[2] = {payload:lines[2]};
output[3] = {payload:lines[3]};
if (output[3]=='ENABLED_STATUS_ENABLED') {
return [output[2]];
}
return [output[1],output[3]];
Below is the debug showing the value of output[1] and output[3].