View Single Post
Old Mar 13th, 2006, 10:24 AM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote