Variables that are declared inside a block but used outside of it (which is possible with a ``++var++``-style declaration) should be declared outside the block.
== Noncompliant Code Example
----
function doSomething(a, b) {
if (a > b) {
var x = a - b; // Noncompliant
}
if (a > 4) {
console.log(x);
}
for (var i = 0; i < m; i++) { // Noncompliant, both loops use same variable