Never use with
statements, since they decrease readability. When you do not specify a variable’s scope, you do not always know where
you are setting properties, so your code can be confusing.
Noncompliant code example
with (foo) { // Noncompliant
return x; // is it a property of foo or local variable ?
}
Compliant solution
return foo.x;