[Talking-Ruby] Operator precedence of ||, or, && and
Operator precedence of ||, or, && and
It’s a matter of operator precedence.
||
has a higher precedence than or
.
1 | a = false || true #=> true |
&&
has a higher precedence than and
.
1 | a = :foo and nil |
References
[3] Operator precedence in Ruby - https://womanonrails.com/operator-precedence-ruby