Byte-Saving Techniques For JavaScript
It seems like there is almost no limit in minimizing the weight of the web pages we are creating.
For the JavaScript part, 140byt.es (a tweet-sized, fork-to-play, community-curated collection of JavaScript) is sharing a set of very useful tips for saving bytes.
They are simply smart replacements for the functions, equations, loops, etc that we are regularly using.
An example from conditionals:
- Before:
if(a)if(b)return c
- After:
return a&&b&&c
A good number of bytes saved : ). The bytes saved are definitely minimal but trying to keep things small and focusing on this is definitely a good habit (but also it is worth considering that such usage can make the code unreadable for other coders).
Special Downloads:
Ajaxed Add-To-Basket Scenarios With jQuery And PHP
Free Admin Template For Web Applications
jQuery Dynamic Drag’n Drop
ScheduledTweets
Advertisements:
Professional XHTML Admin Template ($15 Discount With The Code: WRD.)
Psd to Xhtml
SSLmatic – Cheap SSL Certificates (from $19.99/year)