jQuery is currently the most popular JavaScript DOM manipulation library and provides an abstracted layer for interacting with the DOM in a safe, cross-browser manner. Interestingly, the library also serves as an example of how design patterns can be effectively used to create an API that is both readable and easy to use.
While in many cases the core contributors that wrote jQuery didnât set out to use specific patterns, they exist there regardless and are useful to learn from. Letâs take a look at what some of these patterns are and how they are used in the API.
Get Learning JavaScript Design Patterns 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.