|
There's a big difference in the way you choose to express it. Distinguish between ORing (or ANDing) two values and testing the result against a third, and testing the result of whether or not EITHER (or BOTH) of the two values is equal to another.
if (C == A OR B) tests to see if C is equal to A ORed with B.
if ((C == A) OR (C == B)) test to see if C is equal to A or if C is equal to B.
In some languages, JS among them, == and = mean two different things. The precedence of operations in the language will determine the amount of parenthesization that is necessary for correctness.
|