org.sonar.l10n.javascript.rules.javascript.S878.html Maven / Gradle / Ivy
The comma operator takes two expressions, execute them from left to right and return the result of the second one. Use of this operator is generally detrimental to the readability and reliability of code, and the same effect can be achieved by other means.
Noncompliant Code Example
i = a += 2, a + b; //What's the value of i?
Compliant Solution
a += 2;
i = a + b;
Exceptions
Use of comma operator is tolerated in initialization and increment expressions of for
loop
for(i = 0, j = 5; i < 6; i++, j++) {
}