result.push(right[r++]);
is essentially a shorthand for
result.push(right[r]);
r = r + 1;
The ++ operator after a variable returns the value of the variable before it is incremented.
For comparison, using it before the variable
result.push(right[++r]);
will achieve the same result as
r = r + 1;
result.push(right[r]);
Lucas source
share