Resource citation here :
In a = a || b, a is set by something according to the instructions on each run, whereas with || a = b, a is set only when a is logically false (i.e., if it is zero or false), because || "short circuit". That is, if the left side || the comparison is correct, there is no need to check the right side.
, , dev, , .
EDIT:
, a || a = b a ||= b. :
a , || a = 42 Error, || || 42 42. , .
, , , Ruby , ( a ||= 42).
, , :)
Ruby , || a = 42, , .