I was under the impression that ||
and or
were synonymous.
Setting variable with or
does not hold value; why?
>> test = nil or true
=> true
>> test
=> nil
>> test = false or true
=> true
>> test
=> false
Works 'as expected' with ||
>> test = nil || true
=> true
>> test
=> true
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…