Author: Stoyan Stefanov
Stefanov cuts through the material quickly and in a typical pattern: syntax then functions then object-oriented programming. Things that are the same for both PHP and JS are mentioned in passing or skipped outright. Special attention is given to hoisting, closure, scope, and various methods for implementing inheritance. More so than any other book I’ve read on JS, the author utilizes immediate functions; reading his thoughts on immediate functions alone was worth the read.
After the introduction to the language, Stefanov goes through pretty much the whole built-in API (as of ECMAScript 3). This chapter (chapter 5) makes the book a great reference material to have lying around as it covers in-depth the global functions and built-in constructors and their methods. The oft overlooked Math, Error, and Date are given their due time here and make a great refresher for even experienced JS devs.
The savvy reader may have picked up that it’s on ECMAScript 3, not 5 or 6 (not even 4!) Chapter 6 covers ECMAScript 5 in detail including some of the less commonly used object APIs. The author also covers how to implement ECMAScript 5 while being backwards compatible. Both chapter 5 and 6 are from the perspective of the PHP developer, so each function and method are compared to their PHP equivalent when applicable.
There are no examples to code along with and rarely any external resources to explore, as such this book can sometimes come across like reading a manual. Being familiar with JS (much more so than PHP), I didn’t find this to be a problem but I could see how complex subjects could remain murky without trying out some of the concepts in practice. In fact I liked that it didn’t have coding exercises as I could read in the park and away from my computer. Regardless, this book makes an excellent (if a little outdated) reference to have lying around.