It's getting late and I'm having a brain freeze.
I have a payload which is either boolean true or false. However, sometimes the request times out and an error code is returned as payload which is a negative integer. I'm trying to write a one line if clause in my function node to process the boolean value but not enter the clause if the value is non-integer.
I think
if (msg.payload == true || msg.payload == false) // value is boolean
{
do some processing
}
// the evaluation of true or false failed and the processing did not happen
should work but is there a way of doing something like:
if (msg.payload || !msg.payload) // value is boolean
{
do some processing
}
to evaluate the payload as true or false?
Not explaining to well, but any help would be appreciated. Ta
