All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S878.html Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version

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++) {
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy