When attempting to convert NaN to false, negative numbers are also affected.
-0.2|0 //this operation will always result in zero when the number is negative
I wanted to perform a bitwise operation quickly and inline, minimizing the number of steps, as I am simultaneously storing the result in an array.
array[i]=(sum)|0
Sometimes, my sum value may lead to NaN.
To clarify my question and address the core issue... why is -0.2 considered false when -1 is not? -0.2 is not equal to zero! Zero is false, but -0.2 is a negative value where -0.2!==0.