JavaScript is minified by removing any unnecessary characters and whitespace from the code while preserving its functionality.
Related:
Here are 5 popular JavaScript minification tools:
- UglifyJS: UglifyJS is a popular JavaScript minification tool that is widely used in the web development community. It can minify JavaScript code and also perform code optimisation and mangling.
- Google Closure Compiler: Google Closure Compiler is a powerful tool that can minify JavaScript code and also perform advanced optimisations, such as dead code elimination and function inlining.
- YUI Compressor: YUI Compressor is a JavaScript minification tool developed by Yahoo! It can minify JavaScript code and also perform CSS minification.
- JSMin: JSMin is a lightweight JavaScript minification tool that removes whitespace and comments from JavaScript code.
- Closure Linter: Closure Linter is a tool that can be used to enforce coding standards for JavaScript code. It can also perform JavaScript minification using the Google Closure Compiler.