[Explanation] How assignment operators work.
For example: We want to calculate (x) and (y) using the (+=) operator. var (y) is assigned to let's say 10 (var y = 10;) var (x) will be whatever the user inputs. Let's say my input is 4. So, I want to find out the value of (x += y) In more detail: var y = 10; var x = //user input, or in this case 4. var x = x + y; var x = //changes from 4 to 14. //The output of var (x) would be 14. The same calculation can be performed like this. var y = 10; var x = //user input, or in this case 4. var n = x + y; //The output of var (n) would be 14. Note: We used 3 variables (x), (y) and (n). Whereas using the (+=) operator, we only used 2, (x) and (y), but (x) acts as two variables. Value is temporarily stored to var (x) in this case it's 4. Addition (+) var x = 4 + 10; or var x += y; The result (14) is reassigned (=) to var (x). https://jsfiddle.net/7e1x71Lo/6/ This works the same for any other assignment operator. Also, my explanation might be wrong. So, feel free to correct me.