Foreword by Jeremy Ashkenas
This is a terribly exciting book.
Despite its ignominious origins as a “Java-lite” scripting language, intended to be embedded inline in HTML documents to allow a minimum modicum of interactivity‚ JavaScript has always been one of the most essentially flexible languages for general purpose programming.
You can sketch, smudge, and draft bits of code in JavaScript, while pushing and twisting the language in the direction that best suits your particular style. The reason that this is more natural in JavaScript than in other, more rigid languages is due to the small set of strong core ideas that lie at the heart of JavaScript: Everything is an object (everything is a value) to an even greater extent than in famously object-oriented languages like Ruby and Java. Functions are objects, are values. An object may serve as prototype (default values) for any other object. There is only one kind of function, and depending on how you employ it, it can either serve as a pure function, a mutating procedure, or as a method on an object.
JavaScript enables, but does not enforce, many different programming styles. In the early days, we tended to bring our traditional expectations and “best” practices with us when we started to learn to write JavaScript. Naturally this led to much JavaScript resembling Java without the omnipresent types or even with the types still there, just living inside of annotation comments above each method. Gradually, experiments were ...