Bug report or feature request?
Feature request
ES5 or ES6+ input?
ES5
Uglify version (uglifyjs -V)
uglify-js 3.2.2
JavaScript input
function f(){var h=prompt();return[void 0,h/h]}
The uglifyjs CLI command executed or minify() options used.
Default
JavaScript output or error produced.
function f(){var h=prompt();return[void 0,h/h]}
This can be further optimized as this:
function f(){var h=prompt(),u;return[u,h/h]}
This saves 5 bytes per each undefined usage as long at least one variable was declared in a function scope, at cost of having to use 2 extra bytes for var declaration. var declaration can be inserted in a scope above in event there is a function within a function for extra savings.
Bug report or feature request?
Feature request
ES5 or ES6+ input?
ES5
Uglify version (
uglifyjs -V)uglify-js 3.2.2
JavaScript input
The
uglifyjsCLI command executed orminify()options used.Default
JavaScript output or error produced.
This can be further optimized as this:
This saves 5 bytes per each
undefinedusage as long at least one variable was declared in a function scope, at cost of having to use 2 extra bytes forvardeclaration.vardeclaration can be inserted in a scope above in event there is a function within a function for extra savings.