Jakub Arnold Jakub Arnold - 11 months ago 50
Ruby Question

Difference between "and" and && in Ruby?

What is the difference between the

operators in Ruby?

Answer Source

and is the same as && but with lower precedence. They both use short-circuit evaluation.

WARNING: and even has lower precedence than = so you'll want to avoid and always