4 ms·
It is only harmful if the developer actually used the variable as a side effect, aka relied on it outside the current scope. By making the global variable loca
by zupa-hu 13y ago
It is only harmful if the developer actually used the variable as a side effect, aka relied on it outside the current scope.
By making the global variable local to the scope around the if statement, side-effects won't escape the local scope (as said, the if block does not declare a new scope).