Feature suggestion: optimizing `var` definitions
Author: chrisaljoudiCreated Dec 22, 2012Updated Oct 11, 2024
Hi! I came across a case where there's a possible trick that can reduce size significantly. Take the following piece of code:
var x = 12345678, y = 12345678;It compresses to:
var x=12345678,y=12345678;Can't it be optimized to the following:
var x=12345678,y=x;Or is there something I'm missing? I think it should be available as an unsafe optimization.
Thanks!
Source: mishoo/UglifyJS