Hacker News new | ask | show | jobs
by esrauch 4962 days ago
I think the reason for these is for js minification. With these assignments a simple minifier will replace those three variables with a line like this:

    var a=null,b=true,c=false;
Then your minified js will be smaller because all other instances of true, false and null will be one character. Whether or not this is a reasonable optimization is debatable but in terms of pure code size it would be a win.
1 comments

Couldn't you build it into the minifier rather than polluting the original source?
Yes, stuff like this shouldn't be in the source. UglifyJS and Closure compiler make this optimization, but I've used other js minifiers that did not.