Because (1,2) == 2. You've stumbled across the comma operator (or simpler explanation here).
Unless commas appear in a declaration list, parameter list, object or array literal, they act like any other binary operator. x, y evaluates x, then evaluates y and yields that as the result.