Summary

Two useful JavaScript libraries—jQuery and Underscore—can help you write more compact code, devoid of per-browser checks and boilerplate code, that is easier to understand and maintain.

Although not using a library is certainly an option (Alien Invasion, after all, was built without libraries), the cost of adding both jQuery and Underscore is less than 40 kb, or approximately the size of a small JPG. Take advantage of the hard work that people have put in before you to make cross-browser development easier.

Get Professional HTML5 Mobile Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.