Let me give you an idea using cases and interpretations:
Assuming:
let a = 10;
let b = 0;
Case 1: b = a++
Interprets to:
b = a; // b now is 10
a = a + 1; // a now is 11
Case 2: b = a--
Interprets to:
b = a; // b now is 10
a = a - 1; // a now is 9
Case 3: b = ++a
Interprets to:
a = a + 1; // a now is 11
b = a; // b now is 11
Case 4: b = --a
Interprets to:
a = a - 1; // a now is 9
b = a; // b now is 9
Note
Expression like a++
or --a
changes the original variable. If you don't want to change the original variable, you need to write it like:
b = a + 1;
// Now b = 11 and a is still 10