"Principles of Object-Oriented JavaScript" by Nicholas Zakas, ISBN 978-1593275402
While I did not find too many things new to me in this slim book, it was a great refresher on object-oriented mechanics of JavaScript. Here and there I found interesting tidbits.
A useful explanation in chapter 4 why when setting an object's prototype using this syntax
1 | function Person() { ... } |
you should also restore the constructor property
1 | function Person() { ... } |
Hint: you don't need to do this if you add functions to prototype one by one
1 | function Person() { ... } |
Second useful reminder in chapter 4: sealed or frozen object's prototype is NOT sealed or frozen. You can still modify the prototype and potentially affect the object's behavior.
I liked this book for its clarity and preciseness. Each example demonstrates exactly the topic at hand: constructor stealing, prototypical inheritance, etc. The writing is very very clear, and while this book is not for JavaScript beginners, I highly recommend it to anyone trying to reach a higher level.