If I run the following code in firebug the output equals 0
Code:
y = 5;
x = 0;
z = 1;
newnum = y++ + ++x + x++ + z++ - z++ - y--;
If I test x, y and z on their own in firebug the output is -

Code:
y++;   //  5
++x;  // 1
x++;  // 0
z++;  // 1
y--;   // 5
this makes newnum look like

newnum2 = 5 + 1 + 0 + 1 - 1 - 5; // which outputs 1 in firebug

Is there a particular reason the output of newnum is 0 rather than 1?

Best regards Maxwell