Operators precendence in Ruby
Previously, I thought that &&
and ||
have the same precendence in Ruby;
however, today I know that &&
has higher precendence than ||
, so &&
is
always evaludated before ||
. I look more into the
precedence reference
and find some interesting notes:
- Greater/Less operators has higer precendence than equal operators
&&
has higher precendence than||
, butor
has the same precendence asand
&
also has higher precendence than|