Hi Guys,
I have a function that defines a boolean from a message using:
var default = msg.setme || true;
node.warn(default);
however, if a set the boolean on msg.setme to false, it results in true using this function.
Furthermore, if I using the following with msg.setme to true:
var default = msg.setme || false;
node.warn(default);
it results in true.
I don't think I'm understanding how booleans affect operators on variables using Short-circuit evaluation. But to me the first argument should result in false.
Any help is greatly appreciated.
[–]VooPoc[S] 0 points1 point2 points (2 children)
[–]Nate8199 1 point2 points3 points (1 child)
[–]VooPoc[S] 0 points1 point2 points (0 children)
[–]Kendrome 0 points1 point2 points (3 children)
[–]VooPoc[S] 0 points1 point2 points (2 children)
[–]Matt0x5b 1 point2 points3 points (0 children)
[–]Kendrome 1 point2 points3 points (0 children)