Ok, so I\'ve read about this a number of times, but I\'m yet to hear a clear, easy to understand (and memorable) way to learn the difference between:
if (x |
| is a bitwise OR operator (numeric, integer). it works by converting the numbers into binary and doing an OR for each of the corresponding digits. then again, numbers are already represented in binary in the computer, so no such conversion really takes place at runtime ;)
|| is a logical OR operator (boolean). it only works on true and false values.