If a variable has a literal value then in many cases it makes sense to inline the value, rather than declaring the variable:
// input
var COUNT = 99;
for ( var i = 0; i < COUNT; i += 1 ) console.log(i);
// output
var COUNT=99;for(var i=0;i<COUNT;i+=1)console.log(i)
// better output
for(var i=0;i<99;i+=1)console.log(i)
This is always true when the variable is only referenced once. If it's referenced multiple times, then it depends on the value.
Next level: inlining values that aren't part of the variable initialiser:
var COUNT;
COUNT = 99;
for ( var i = 0; i < COUNT; i += 1 ) console.log(i);
If a variable has a literal value then in many cases it makes sense to inline the value, rather than declaring the variable:
This is always true when the variable is only referenced once. If it's referenced multiple times, then it depends on the value.
Next level: inlining values that aren't part of the variable initialiser: