The comma operator in JavaScript.(jsfiddle.net)
jsfiddle.net
The comma operator in JavaScript.
http://jsfiddle.net/RfZed/
2 comments
var x = 5, y = 6 // typical JS
(2,4) // returns 4
thus,
test(2,4) adds 0, 2 and 4
test((2, 4)) adds 0 and 4
(2,4) // returns 4
thus,
test(2,4) adds 0, 2 and 4
test((2, 4)) adds 0 and 4
http://jsfiddle.net/RfZed/2/