What if we want to change a variable based on its current value? There's a shorthand notation for that.

It works by combining the operator needed and equals. Let's try it here.

Nice! These compound assignment operators, use the value that's stored in the variable before them and assign it back to the variable.

Psst: the -= operator works in exactly the same manner.

To use this shortcut we need a combination of the operator and equals.