AND & OR Operators Precedence

Are you still sure that && and and is the same operators? Look at this:

a = true && false


=> false

a = true and false


=> true

The same situation could be reproduced for || and or. Why? The answer lies in Ruby Operator Precedence.

The first example can be represented as:

a = (true && false)


(a = true) and false

Thanks to Igor Alexandrov

Do you have a project for us?Get a free quote