A JavaScript pattern and antipattern collection that covers function patterns, jQuery patterns, jQuery plugin patterns, design patterns, general patterns, literals and constructor patterns, object creation patterns, code reuse patterns, DOM and browser patterns (upcoming).

Patterns collected while developing 喜感网.

General Patterns

jQuery Patterns

Selector

Publish–subscribe

jQuery Plugin Patterns

Literals and Constructors Patterns

Function Patterns

API Patterns

Initialization patterns

Performance patterns

Object Creation Patterns

Code Reuse Patterns

Classical Patterns (patterns that should generally be avoided)

Preferred Patterns

Design Patterns

Creational

Structural

Behavioral

References

  1. The Essentials of Writing High Quality JavaScript
    http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
  2. JSPatterns
    http://www.jspatterns.com/
  3. jQuery Anti-Patterns for Performance & Compression
    http://paulirish.com/2009/perf/
  4. How DRY Affects JavaScript Performance
    http://velocityconf.com/velocityeu/public/schedule/detail/21634
  5. Object Oriented JavaScript
    http://www.packtpub.com/object-oriented-javascript/book
  6. JavaScript Patterns
    http://shop.oreilly.com/product/9780596806767.do
  7. JavaScript: The Good Parts
    http://shop.oreilly.com/product/9780596517748.do
  8. Pro JavaScript Design Patterns
    http://jsdesignpatterns.com/
  9. Essential JavaScript Design Patterns For Beginners, Volume 1.
    http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/
  10. Eloquent JavaScript
    http://eloquentjavascript.net/