I'm trying to evaluate a value in node red :

from the join node I'm getting the following:
so what I'm trying to do in the function is to check the 1. sent value:
var payload = msg.payload;
if (msg.payload[0] === "0" ){
msg.payload =0;
} else {
msg.payload = 1;
}
//msg.payload = payload[0];
return msg;
So my question why am I getting the if statement is false ?
thanks for any hint
