I have found a program to compress Javascript code before and I have been using it and it works well.
http://javascriptcompressor.com/
Online compression of Javascript source code
Just clean up spaces, newlines, redundant comments, etc., especially select Shrink variables, long variable names will be reduced into single-letter variable names, and the compression ratio can usually reach 50% or less. Now that AJAX is very popular and JavaScript files are getting larger and larger, using this compression should reduce a lot of traffic burden. Moreover, after shortening the variable name, the program is not encrypted, but it will make the program difficult to understand. It can also protect copyright to a certain extent.
Today I found a code formatting program
http://elfz.laacz.lv/beautify/
You can compress the JS code Reformat it to make it easier to read. Of course, if the variable names are reduced during javascriptcompressor.com compression, the original meaningful variable names cannot be restored.
When encountering a particularly large JS file, the browser will report that it takes too long and choose not to stop. Eventually it will complete the execution.