What is comma operator in JavaScript. If I execute
var a = 1;
var b = 2;
a,b
I get
2
What is comma operator in JavaScript. If I execute
var a = 1;
var b = 2;
a,b
I get
2
The comma operator evaluates each of its operands (from left to right) and returns the value of the last operand.
From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator
More on: http://javascriptweblog.wordpress.com/2011/04/04/the-javascript-comma-operator/