Hacker News new | past | comments | ask | show | jobs | submit login
Understand the concepts of JavaScript miniaturization (makingthingssimpler.com)
2 points by whoshallsucceed on Nov 27, 2012 | hide | past | favorite | 1 comment



There'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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: