简体   繁体   中英

optimized/minifed javascript code but still readable/maintainable

I'm a beginner at javascript and learn a lot by looking already written code.

Some large javascript projects I've looked at have minified code and when expanding it it's not very readable.

almost all variables and functions are just defined by a letter looping trough the alphabet ie ab c, aa, bb, cc and so on, also no commenting.

Out of curiosity is this a coding style or is there a tool that you use to optimize the code with?

seems hard to maintain such a project.

No, it's not a coding style (except if you're doing code-golfing manually for fun).

You take the unminified code and squeeze it through a tool such as https://github.com/terser/terser (which is probably the most popular at the time of writing).

You can see what Terser does online with their Try Terser tool. https://try.terser.org/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM