I had a general knowledge of this. It is the operator precedence chart. The shift operator has higher precedence than the logical operators (&& ||). I had a situation like this, where arr was an array and party was nil:
arr << party && party[3] Now initially when I did this I thought if party was nil than party[] would never be called. Of course, since << has higher precedence it tries this first:
arr << party But what happens next? Does ruby then do this:
arr << party[3] Note that I used the highest operator () to resolve the issue:
arr << (party && party[3])