Alternatively, replace "||" with "or" - "or" has a lower precedence than "=" while "||" has a higher one. This means that
foo = bar || wibble;
is evaluated as
foo = (bar || wibble);
i.e. the || is done first, producing a boolean result, and then the = assigns that result to foo; just as Conncha Fahy describes.
On the other hand:
foo = bar or wibble;
evaluates to
(foo = bar) or wibble;
which means that bar's value is first assigned to foo (which is what you want), only if that value is false does wibble get looked at.