From what I understand, a ||= 7
means the following:
if a
has a value, continue using that value, but if it does NOT have one, then set it to 7.
Here is what happens though.
If i have a
and b
as:
a = true
b = false
then
a ||= b
=> true
(in my interpretation: since 'a' DOES have a value, it remains that, and does not get equated to 'false' - so far so good.)
However, if i have them switched up like:
a = false
b = true
then a ||= b
=> true
so in this case my logic does not work, since it should return false, as "since 'a' has a value, it should not be assigned the value of 'b'", which apparently happens here.
Am I missing something?