Rewriting this for clarity:
You can do the same with the +, -, and * operators, as well as with many others, as a shortcut:
var duration = 2; // declaring the variable "duration" and assigning it the value of 2 duration += 2; // duration = duration + 2 // now duration is 4 duration *= 2; // duration = duration * 2 // now duration is 8 duration -=4; // duration = duration - 4 //now duration is 4 again
Jannaee
source share