Last Updated: February 25, 2016
·
297
· mejarc

And vs. &&

Give the following a try to process the difference:

a = 'this' && 'that'
b = 'those' and 'these'

p a
p b

&& obtains the second of the values('that')
and obtains the first ('these'), thanks to operator precedence.

rubocop prefers we use &&.

Excellent explanation from Avdi Grimm.