Difference between “or” and || in Ruby? [duplicate]
It’s a matter of operator precedence. || has a higher precedence than or. So, in between the two you have other operators including ternary (? 🙂 and assignment (=) so which one you choose can affect the outcome of statements. Here’s a ruby operator precedence table. See this question for another example using and/&&. Also, … Read more