compression : Removes all comments, tick marks, line breaks, and useless spaces in Javascript code, compressing the JS file size.
How JavaScript files are compressed
The first, of course, is to remove the comment .
The other is the same as the CSS compression to remove line breaks , spaces or something.
JavaScript has several variable forms, such as variables, function names, function parameters, and so on, usually when we write JS code, in order to facilitate understanding, we will give these variable names with intuitive strings, such as: Var title= "JavaScript", this habit is worthy of praise.
However, these variables are helpful to the user's understanding, and to the computer, if we turn the previous sentence into: Var a= "JavaScript", it is the same for the computer.
Usually deep compression JS must do a step is to shorten the variable name as much as possible , because a large volume of JS code, where the variable name will occupy a lot of space.
How to compress JS and CSS files