Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
would become:
The
? :operator can be used now, since the comma operator (to a certain extent) allows for two statements to be written as one statement.This is useful in that it allows for some neat compression (39 -> 24 bytes here).
I’d like to stress the fact that the comma in
var a, bis not the comma operator because it doesn’t exist within an expression. The comma has a special meaning invarstatements.a, bin an expression would be referring to the two variables and evaluate tob, which is not the case forvar a, b.