a ||= b
is short for a = a || b
In ruby nil
, evaluates to false. So if a is nil
or false
, a will be assigned b’s value
1
solved Ruby Operators difference [duplicate]
a ||= b
is short for a = a || b
In ruby nil
, evaluates to false. So if a is nil
or false
, a will be assigned b’s value
1
solved Ruby Operators difference [duplicate]