When using IIS 7.0 to host your website on a Windows server, you can configure IIS to automatically compress your JavaScript files using the GZIP compression algorithm, which provides significant improvements in performance and file download size. However, you can get additional performance benefits by compressing and minifying your JavaScript files at the same time. Steve Sounders writes in his excellent book
Here is the JavaScript file minified using Microsoft Ajax Minifier (with super squish level enabled):
Note that all unnecessary whitespace has been removed. Also note that the function parameters firstValue and secondValue have been renamed to b and a.
Microsoft Ajax Minifier download contains the following components:
After installing Microsoft Ajax Minifier, you can use the Microsoft Ajax Minifier command line tool to minify JavaScript files on the console command line.
You can also choose to add Microsoft Ajax Minifier as a custom MSBuild task to Visual Studio. Adding this MSBuild task to your Visual Studio project file allows you to automatically minify all JavaScript files at any time when compiling, allowing you to perform minification operations in an automated manner.