a = a + 1; // 将a的值加1再赋给a
a += 1; // a = a + 1
a++; // Assign the value of a to a variable and increment it
++a; // Assign the value of a to a variable
Copy the code

For example:

var a = 0;
b = a++; // b = a; a = a + 1; B =0, a=1;
Copy the code
var a = 0;
b = ++a; // a = a + 1; b = a; B =1, a=1;
Copy the code