The Joy of JavaScript

The Joy of JavaScript / Luis Atencio / Manning / February 2021

Rating: 4/5 🌕🌕🌕🌕🌑

This is targeted at advanced engineers who are already comfortable in JavaScript and want to learn some new tricks. Most of the parts of the language covered are relatively new, with some features that are still on TC39 proposal level.

The book’s exposition is divided into 4 parts - “Objects”, “Functions”, “Code” and “Data”. I like that idea of building up from the basic concepts and keeping a stern structure.

Part 1, “Objects”, gives a thorough look at how prototypal inheritance works, composition, mixins, etc.

The second part, “Functions”, is a good introduction to modern functional programming. It starts with the basics - composition/currying, and ends with more advanced topics, like monads and ADTs.

Next is “Code”, which covers two somewhat different topics - module systems (from IIFE to ESM) and metaprogramming (including “magic” symbols, e.g. for making objects iterable). This part was really interesting, as both topics are not always well-understood, even by senior engineers.

The last part is “Data”, which deals with promises, async/await, generators, and observables. There weren’t many surprises here and most of the JS engineers, especially working on UIs, are probably already familiar with most of the stuff.

Instead of presenting concepts with artificial examples, the book gradually builds a relatively full-bodied example project (blockchain). But, sometimes the “abstraction” is not very good - certain things have to be omitted, others have to be repeated, and so on. In my opinion, these examples don’t always serve the presented theory perfectly, but they’re still really good, most of the time.

In conclusion, the book is good for everyone eager to learn some new JS tricks. I subtracted one point and gave 4/5. That’s mostly because I found some of the things covered to be too basic for an “advanced” book and serve more as “fillers”, e.g. the section about promises - while the ADT analogies are useful, I’m certain most of the audience is already accustomed to the rest of the concepts (as I pointed out above).