You already know the basic assignment operator =, which stores a value in a variable. But what if you want to modify a variable based on its current value?
For example, when your Codémon gains experience points, you want to add to its existing XP:
↗️
Loading editor...
↶
↷
This pattern of variable = variable + value is so common that JavaScript provides a shortcut: compound assignment operators.
The code above can be rewritten as:
↗️
Loading editor...
↶
↷
Both ways do exactly the same thing, but += is shorter and clearer!