A combination of attempting to rewrite the book's sample code in JavaScript and annotated JavaScript patterns I found online.