Can anyone explain these two figure( +=, -=)


What are these two symbols stand for( +=, -=)
and how to place it, can anyone give me an example and illustrate it, tks


They are called 'operators' just as any other of their type. However, they are compound operators in that they perform two operations at once. The value is applied to the expression and the reassigned back on to the same variable.

a += b

is the same as writing,

a = a + b

Clearly the former is more programmatic, hence its ready adoption.


thanks for your illustration~~