MDN claims that:
The comma operator evaluates both of its operands (from left to right) and returns the value of the second operand
Comma(,) is also a parameter separator.
(,)
Use alert((1,2)) instead.
alert((1,2))