Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 171 Bytes

array_bitwise_or_assignment.md

File metadata and controls

17 lines (11 loc) · 171 Bytes

Bitwise OR assignment

Usful if you need a uniq list of elements

x |= y

is shorthand for:

x = x | y

example:

x = [1,2,3]
x |= [3,4,5]
x #=> [1, 2, 3, 4, 5]