Often, people compress their JavaScripts using Dean Edwards' Packer. The snippet
document.write('Hello, world!');
would then become
eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0.1(\'2, 3!\');',4,4,'document|write|Hello|world'.split('|'),0,{}))
where you can cleary see, that JavaScript is used to unpack the source code. So you pay the smaller size with the time needed to decompress the whole thing. For larger scripts (such as JS-frameworks) this can take several seconds - even on 2 GHz computers.
To unpack the compressed script, you need to replace the eval( by document.write(. Since your browser will try to interpret a smaller-than character as a HTML-tag, you need to write the output into a TEXTAREA. For our example, the unpacking code will look like this:
document.write('<textarea cols="120" rows="10">'); document.write(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0.1(\'2, 3!\');',4,4,'document|write|Hello|world'.split('|'),0,{})); document.write('</textarea>');
Which will result in the following: