Compressing JavaScript

Google Closure Compiler

By running your JavaScript through the Google Closure Compiler you can realize a few benefits.

  1. Your page will download quicker.
  2. Your code will be obfuscated.

The only downside is you will have two copies of your code so making changes is a bit of a pain. So, make this the last step before you deploy.

UglifyJS

Jeremy Kahn, as described in the excellent article Treating JavaScript Like a 30 Year Old Language, expounds upon his preference for UglifyJS.