3 ms·
I hope everyone is upvoting this just for science. DON'T use these all the time, leave this job for a minifier and focus on maintainable code.
by ricardobeat 16y ago
I hope everyone is upvoting this just for science. DON'T use these all the time, leave this job for a minifier and focus on maintainable code.
- po 16y agoI think this is meant to be a fun project that gets people to learn some of the quirks in the Javascript language. It reminds me a little bit of code obfuscation contests: the more deeply you understand the language, the better you will do. The advantage here is that it's not intentionally misleading and actually could be useful.
- jedschmidt 16y agoThis is a good point. If you're going to write minified code like this, you should at least annotate it liberally like this example: https://gist.github.com/962814 https://gist.github.com/962814
- code_duck 16y agoI agree... some of them are handy tricks that don't make the code obfuscated or less readable, but not all. Some people think code like this is clever or desirable, too. Also, I've actually seen code in jQuery plugins such as if(condition) //{ //save a byte! action(); //} // save a byte! as if leaving out the braces will actually make your code run faster, or make a real difference after minification. I could easily see that sort of person thinking this article is like an elite JavaScript style guide.