A document [1] by Ray Cromwell introduces an aid for JS compression, both theory and implementation [2]. The idea is to transform JS code before compression in a way that, while keeping JS semantics, makes is best possible candidate for the popular gzip deflate compression.
I thoroughly recommend taking the time to read it.