if given the following
a = [1,2,3]
b = [3,4,5]
a&b #=> [3]
b - a&b #=> [4,5]
b - a #=> [4,5]
why does this work
[1,2,3] - [3] #=> [1,2]
but not this
a - a&b #=> [] ??
if given the following
a = [1,2,3]
b = [3,4,5]
a&b #=> [3]
b - a&b #=> [4,5]
b - a #=> [4,5]
why does this work
[1,2,3] - [3] #=> [1,2]
but not this
a - a&b #=> [] ??
Because -
has higher precedence here than &
:
a - (a&b)
# => [1, 2]