Advertisement
728x90
The comma operator is used to evaluate each of its operands from left to right and returns the value of the last operand. This is totally different from comma usage within arrays, objects, and function arguments and parameters. For example, the usage for numeric expressions would be as below,
javascript
1var x = 1;
2
3x = (x++, x);
4
5console.log(x); // 2Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 79
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
250of476