Assignment operators


Assignment operators (+=, -=, *=, /=) are operators that combine variable assignments (=) with arithmetic operators. They serve as a shortcut when coders have to perform an operation that changes the value of a variable. If a rock falls on a game player’s head, health needs to be subtracted from their total, and so on.