UPDATE: This is a duplicate question, answered here: What does this symbol mean in JavaScript?
I couldn't find an answer to this question on SO, and managed to answer my question while researching it and composing the question.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Decrement_(--)
The code example is using the postfix incrementing operator. A postfix operator will first return the current value and then increment it.
var x = 1;
x++; // returns 1, x === 2
This is in contrast to the prefix incrementing operator, which will first increment the value and then return the incremented value.
var y = 1;
--y // returns 0, y === 0
Regarding the +=
and -=
assignment operators: these operators also increment the value and then return the incremented value.