This sounds like a great idea but after taking a look at this “book,” I must say it’s the weakest collection of patterns I’ve ever seen. Its extreme brevity makes it downright confusing, and the examples are so simplistic, that I am not sure they are really demonstrating anything. For example, probably 80% of jQuery scripts begin with
$(document).ready(function(){ ... });
or some analogue. This is presented, without explanation, as an example of the “Lazy Instantiation Pattern.” What!?Here’s an actual pattern (if not a design pattern), just from my own experience: Some people like to always name variables holding jQuery instances with names beginning with $. For example:
var $toggles = $('.toggle');
Useful in that you know, at a glance, how to interact with that variable (e.g. .html() instead of .innerHtml).