When is the comma operator useful?
The following is probably not very useful as you don’t write it yourself, but a minifier can shrink code using the comma operator. For example: if(x){foo();return bar()}else{return 1} would become: return x?(foo(),bar()):1 The ? : operator can be used now, since the comma operator (to a certain extent) allows for two statements to be written … Read more