What does "+=" (plus equals) mean?
Expressions with binary operators of the form:
x = x op y
Can be written as:
x op= y
For instance:
x += y # x = x + yx /= y # x = x / yx ||= y # x = x || y (but see disclaimer)
However, be warned that ||=
and &&=
can behave slightly ... different (most evident when used in conjunction with a hash indexer). Plenty of SO questions about this oddity though.
Happy coding.