Hi, why in the second case the non declared “my_var” variable is
processed but not in the first case?
irb> nil || 2 || my_var
irb> nil | 2 | my_var
NameError: undefined local variable or method `my_var’
Of course, I prefer the first case: 2 is already true so there is no
reason to read the next “my_var”. Also, it’s not good for performance,