Understand the concepts of JavaScript miniaturization
makingthingssimpler.com
Understand the concepts of JavaScript miniaturization
1–2 of 2 posts
Re: Understand the concepts of JavaScript miniaturization
#2There's a bug in the first optimization example. Specifically, class "point"'s "up" and "down" methods still reference the "move" method as "move" instead of "b". It can be fixed by replacing the original statement "p.move(10)" with "move.call(p, 10)" for the "up" method (and similarly for the "down" method).
Despite the bug, I think it illustrates a good point. You can adopt a specific coding style that help you achieve higher level of minification/obfuscation.
It would be nice if languages like TypeScript can perform this transformation for you.