Essential JavaScript Design Patterns 1.1 – A Free Updated Book For Beginners


Hey guys. Today I'm happy to announce the release of an update to my free book 'Essential JavaScript Design Patterns'. This revised edition comes with several re-writes to the original release and also includes introductions to extra patterns not initially covered. In addition, some patterns have had expanded examples added, making this a better overall introduction for those wishing to learn more about design patterns in JavaScript.

Update: Version 1.5.x of the book and above are available in either online form to read for free or via O'Reilly if you'd like to pick up physical or eBook formats of the book. The latter is a lot more visually pleasing than the PDF/eBooks I used to generate and I hope this combination of free or purchase options satisfies most readers needs. The below version (1.1) should be considered old and I would strongly recommend looking at the newer version. There have been a lot of large rewrites, corrections and new sections added.

You can download my book and learning resources right away or read online if you'd prefer. 





Thanks To The Community

Before I take you through the changes in this edition, I would like to thank the community for their interest in the book. Version 1.0 was downloaded over 260,000 times, far exceeding my expectations on the developers interested in further education on design patterns.

If you tweeted or 'like'd the book last time, I appreciate you helping to spread it.


What's Been Updated?

In the first edition of my book, I aimed at finishing all of the writing on it in a relatively short period of time, meaning that there were some rather silly mistakes we didn't catch in our reviews. I also wasn't able to balance the amount of material covering general design pattern education vs,  the amount of time spent discussing implementations in JavaScript, which I've tried to improve on in this edition. There should now be equal amounts of both (as requested by readers).

The changelog for this edition is as follows:

  • Grammar and semantic changes across the initial sections on design pattern theory corrected
  • Re-writes of the pattern explanations for many of the patterns in the JavaScript section
  • New pattern additions to the JavaScript section including Observer (Pub/Sub) and Command as well as one new addition to the jQuery section
  • Code fixes for examples with minor changes required

Patterns mentioned in 1.1 include:

  • Creational Pattern
  • Constructor Pattern
  • Singleton Pattern
  • Module Pattern
  • Revealing Module Pattern
  • Observer Pattern
  • Prototype Pattern
  • Command Pattern
  • DRY Pattern
  • Facade Pattern
  • Factory Pattern
  • Mixin Pattern
  • Decorator Pattern

ePub/Mobile Editions

With the first edition of the book, a large number of community members requested formats such as PDF and ePub become available. Rather than using a one-click/automated process to achieve this, I prefer to manually reformat the pages for each format as this results in a better quality experience for you. Although these formats will not be initially available, I'll be updating this post with links as soon as they are.


Why A Free Book?

There's some really fantastic literature available out there on design patterns in JavaScript (Stoyan Stefanov's excellent 'JavaScript patterns' book comes to mind) but a lot of the JS-centric material requires purchased literature.

These books are definitely worth buying, but I personally feel that until a developer is interested enough in learning about patterns to make the leap to invest in these, the majority of material they have accessible online doesn't focus enough on how to apply design patterns to JavaScript or jQuery. That's where having a free book of this nature comes in useful.



I was the primary author of this book but I would like to thank JavaScript and design pattern enthusiast Alex Sexton for technically reviewing the content and ensuring that it was accurate. Alex also provides some insightful feedback on the book's content that helped improve it. I would also like to extend my thanks to Rebecca Murphey as her open-source book 'jQuery Fundamentals' served as the inspiration for me aiming to create a piece of useful free content that goes beyond the depth a standard article would. This book also couldn't have been completed without the writers who published the original pieces on patterns that helped teach me about them. I've hopefully referenced all of you, but if not feel free to get in touch and I'll put that right straight away. Last but not least, I'd like to thank the community for their feedback and change requests which helped improve the book from version 1.0.


What Does The Book Pack Contain?

The downloadable version of the book pack contains:

  • My 'Essential JavaScript Patterns' Book (Version 1.1)
  • Printable Design Pattern sheets (courtesy Jason MacDonald)
  • Design Pattern Reference Cards (courtesy of DZone)



That's it!. Thanks for checking out this post. If you found my book helpful and would like to share it with your friends or colleagues, please feel free to click the retweet button below. Together we can help spread more awareness of design patterns in the JavaScript and jQuery communities.

Update: If you would like to contribute or post an issue regarding the book, you can now find EJDS on GitHub here.


  1. Pingback: Wzorce projektowe w JavaScript – darmowy ebook | Hello World!

    • Thanks Cheyne. I plan on updating the publication as and when new suggestions or fixes are reported so if you or anyone else wish to let me know about anything I've missed, feel free to let me know!.

  2. Very nice, reading now, one point though, you should say "bear in mind", not "bare in mind", otherwise people might give you funny looks 😉

  3. You write “it’s” in a few places when you should write “its” instead. If you expand the contraction “it’s” by replacing it with “it is,” you will see the problem. Thanks!

  4. Singleton Pattern, 2nd example, last line. The comment says “logs”, while the code is for an alert. Why not consistently use console.log() ? :)

  5. Pingback: SWL-Projekt » Wzorce projektowe w JavaScript – darmowy ebook

  6. Addy,

    As a user on the Reddit forums has pointed out, under the section "Constructors With Prototypes", you should take care when assigning methods to the prototype by not overriding the prototype object itself.

    Your example would be better written: Car.prototype.toString = function() { … };

    The difference being, that you are implementing a toString method on the already present prototype object, rather than redefining the prototype object with an object that only has a toString method.

  7. Pingback: Essential JavaScript Design Patterns 1.1 – A Free Updated Book For … :

  8. Hey kmueller. Thanks a lot for informing me about the comment noted on Reddit. In hindsight I agree, redefining the prototype object just for the purpose of that particular example may not have been the most efficient approach. I've updated the code sample as per suggested and added an additional comment inline to ensure that readers have access to the better version. Cheers!

  9. Pingback: Essential JavaScript Design Patterns | Front end Blog

  10. Pingback: Pedro Newsletter 02.02.2011 « Pragmatic Programmer Issues –

  11. I’m enjoying your book. (ePub or PDF would be great!) In your first singleton example you have:

    But since “getInstance” is a method it should be:


  12. Pingback: I link della settimana | Appunti d'informatica

  13. Pingback: World Wide Web Rock Club | Nerdson não vai à escola

  14. Great book! Thx!

    Typo in Constructors With Prototypes?

    Line 11:

    Car.prototype.toString: function(){
    return this.model + " has done " + this.miles + " miles";

    Shouldn't it be = instead of : ?

  15. /*No need for capitalization as it's not a constructor*/
    var someCar = {
    drive: function() {};
    name: 'Mazda 3'

    Shouldn't it be a comma instead of semicolon after the drive function?

  16. Pingback: Funciones autoejecutables en Javascript | EtnasSoft

  17. Pingback: Introduction To JavaScript Design Patterns – a Free eBook | ChurchCode

  18. Thanks a lot for this! It was a fun read, and it's great that you were able to produce such high quality work for free :) I thought I might be able to help out–here are some errors in the text:

    – Under "Observer Pattern", there is a code example titled "Subscribing and publishing". Line 20 references a variable called "o", where it should be "obs"
    – Under "Command Pattern", the fourth paragraph uses "asme" instead of "same"
    – Under "DRY", the code example labeled "Non-dry" has an unescaped string on line 23
    – Under "Decorator Pattern", the second paragraph reads "you need to keeping adding", but I think you meant "you need to keep adding"

    …pretty minor stuff, but it sounds like you're interested in stamping these bugs out. Thanks again!

    • Thanks a lot for pointing these out, Mike. I appreciate it :) All of the changes you've mentioned have been made and are now live in both the online and downloadable copies of the book. Cheers!

  19. Pingback: Follia Digitale » Essential JavaScript Design Patterns 1.1 – A Free Updated Book For Beginners

  20. Thanks a lot for the book.
    Just noted something in 'The Mixin Pattern' part.
    In the augment function , the part where you add only some specific functions, shouldn't the for loop start from 2 instead of 0.

  21. Pingback: Design patterns til Javascript | Hennings blog

  22. Pingback: JavaScript Entwurfsmuster für Einsteiger « MARTINSFELD

  23. Hi ,
    Here are also my comments added for Web Design and Web Development which may prove helpful for the People who are working for such Specific Categories.During staying on line for SEO services Many points Were added for the people attraction .

  24. Hello Dear,
    Nice post to sharing its great to i added my comment also for Software House In Pakistan.
    and here are certainly a lot of details like that to take into consideration. That is a great point to bring up admin.
    Software House In Pakistan

  25. Pingback: Addy Osmani – Scalable JavaScript Design Patterns | Web Directions

  26. I would like to thnkx for the efforts you’ve put in writing this blog. I am hoping the same high-grade website post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own website now. Really the blogging is spreading its wings fast. Your write up is a good example of it.

Leave a Reply

Required fields are marked *.