top | item 6779953 The comma operator in JavaScript. 1 points| valera_rozuvan | 12 years ago |jsfiddle.net | reply 2 comments order hn newest [+] [-] frdmn|12 years ago|reply Take a look at this:http://jsfiddle.net/RfZed/2/ [+] [-] matthiasak|12 years ago|reply var x = 5, y = 6 // typical JS(2,4) // returns 4thus,test(2,4) adds 0, 2 and 4test((2, 4)) adds 0 and 4
[+] [-] matthiasak|12 years ago|reply var x = 5, y = 6 // typical JS(2,4) // returns 4thus,test(2,4) adds 0, 2 and 4test((2, 4)) adds 0 and 4
[+] [-] frdmn|12 years ago|reply
http://jsfiddle.net/RfZed/2/
[+] [-] matthiasak|12 years ago|reply
(2,4) // returns 4
thus,
test(2,4) adds 0, 2 and 4
test((2, 4)) adds 0 and 4