Top 7 Must-Read JavaScript Books For Interview Preparation
Books are a great way to learn how to code. It wasn’t too long ago when books were one of the only resources that people had access to when learning to code. I still remember when 14 year old me went over to the library across my house to borrow Sam Teach Your Self C++ in 24 Hours and C++ for Dummies. In 2020, it seems that people learn mainly through either video courses, reading online tutorials, or just simply googling/stackoverflow-ing for answers.
I still believe learning through books can be extremely effective. For one, they include a good overview and roadmap of the sub-topics that need to be covered. Usually the authors who wrote these books are experts in their domain and give very detailed and insightful analysis about the topic. Another reason why I like books so much is that you can really slow things down and digest the information slowly. When trying to understanding core and fundamental concepts, it is important to digest the information slowly and thoughtfully, or else we end up forgetting or not understanding them at all.
Here are the 7 books that I believe all JavaScript and Frontend Developers should read. I own all these books both in physical and digital form and have read them at least once. I’m sure there are a ton more books out there that I have not read or even heard about, but this is just my list.
- You Don’t Know JS by Kyle Simpson
- Secrets to the JavaScript Ninja by Bear Bibeault and John Resig
- JavaScript the Good Parts by Douglas Crockford
- JavaScript the Definitive Guide by David Flanagan
- JavaScript, Data Structures and Algorithms by Sammie Bae
- Eloquent JavaScript by Marijn Haverbeke
- Effective JavaScript by David Herman
1. You Don’t know JS Book Series
The YDKJS book series is not just a single book. It’s a series consisting of 6 books in total. The first book is an introduction to the rest of the 5 books. The 5 books are as follows:
- Scopes & Closures
- this & Objects Prototypes
- Types & Grammar
- Async & Performance
- ES6 & Beyond
Kyle Simpson is a very notable figure in the JavaScript community, I have followed him for the last 5 years. Make sure to check out his courses on Frontendmasters. He gives great talks and lessons on core fundamental concepts in JavaScript.
YDKJS: Scopes & Closures
This book is less than 100 pages long and is a very enjoyable read. It covers the most essential topics related to scopes in JavaScript like lexical scoping, block scopes, hoisting, and much more. This is probably the best book to get started with the series because it covers a lot of ground with such a short number of pages. For interview preparation, I would highly recommend reading this book because having an understanding of scopes and closures can massively increase your overall JavaScript knowledge, which in turn will increase your chances of acing interviews.
YDKJS: this & Objects Prototypes
This & Objects Prototypes is a great book all on its own. Kyle Simpson goes in depth about the usage of the ‘this’ keyword and its nuances in JavaScript and explains it very clearly. He also goes about explaining Object(s) Oriented vs Class Oriented Programming and why understanding the JavaScript prototype system is different if you are coming from a more traditional computer science background. This is my favorite book in the series because the diagram in which he showed on pages 123 – 125 was what gave me a complete understanding of how the prototype system works in JavaScript. For interview preparation, I would definitely read this book. I would highly encourage someone reading this book to read it more than once because I found this book to be the most challenging out of the other ones.
YDKJS: Types & Grammar
Perhaps one of the less popular books (I would imagine). This book goes deep into the different built-in types that exist in JavaScript. Kyle Simpson elaborates on topics such as understanding JavaScript’s type system, type coercion, auto-boxing, == vs ===, strict mode, and various other nuances of the JavaScript language that are not present in other popular languages we use today. For interview preparation, I would not worry too much about reading every nitty-gritty detail of the book. I would focus on main topics like understanding basic coercion and knowing the behavior of the different built-in types that JavaScript has.
YDKJS: Async & Performance
Async & Performance is likely the most pragmatic and relatable book that I read out of all the other ones. Reason why is because this book talked about topics we as Web Developer see every day. These include callback hell, promises, and learning how to write better asynchronous code in JavaScript. The topics that were most relevant to interview preparations would most likely be the first 3 chapters. Those would include knowing how the event loop works, why callbacks are actually hell, and why promises are a way to go. This book does talk about generators, but most recently Kyle has come out with new content in his other works where he teaches about async/await. In his new book series, You Don’t Know JS Yet, he goes more into details about the new features in asynchronous JavaScript.
YDKJS: ES6 and Beyond
Finally, we arrive at the final book of the series, ES6 and Beyond. If you are reading this in 2020 or beyond, it could be a little out of date. Nonetheless, the book is still a good read as it goes into detail about the new API additions to the Array and String APIs in JavaScript. It also delves deep into new syntax like arrow functions, spread operator, de-structuring and much more. I especially like how Kyle was able to break most of the new ES6 additions into manageable chapters. This made it a lot easier for someone who has stepped out of the realm of JavaScript to be able to come back with ease. For interview preparation, I wouldn’t worry too much about the entire book, but rather use this as a reference to review which areas of ES6 you are weak at.
2. Secrets of the JavaScript Ninja
Secrets of the JavaScript Ninja by John Resig and Bear Bibeault is a book that would recommend to someone who needs to cram for a JavaScript interview in a matter of weeks. It gives a great general overview of the not-so-easy to understand topics in JavaScript. There has recently been a new version released in 2016/2017, the version I own is the first edition released back in 2012. The two books are quite different, but having read the 1st edition, I’ll give my take on that rather than the brand new 2nd edition.
The 3 key sub topics that this book excels at in my opinion are functions and scopes, objects and prototypes, and JavaScript's DOM API. Part 2 of the books covers scopes and prototypes very well. There are a ton of good figures and diagrams that make reading the book extremely easy on the eyes. Chapters 12 through 15 were very useful as well as the books talks about concepts such as event delegation, manipulating the DOM and CSS with JavaScript, and cross browser concerns. The illusrations and diagrams in the book made understanding the DOM and CSS selectors extremely easy, it’s no wonder John Resig is the Creator of jQuery.
3. JavaScript the Good Parts
Ah yes, JavaScript: The Good Parts, probably the most well-known JavaScript book ever to be written. This book is definitely a tough read. Not because the concepts are any different from any of the other books, but because this book is for someone who already knows JavaScript extremely well. I remember reading this book for the first time. It was the year 2013, I tried reading some of it and thought I understood it, in reality, I had literally zero clue as to what I was reading. This is because the book is just a review of the “good” parts. For example, chapter 4, consisting of less than 20 pages talks about scopes, closures, currying, recursion, and memorization all in less than 10 pages. For interview Preparation, I would say if you are already a JavaScript Guru (like me XD), then maybe you can read this a couple of days beforehand to get your mind into the interview game. I would not recommend anyone thinking that reading just this book is enough to be prepared for an interview, let alone understand core concepts in JavaScript.
4. JavaScript the Definitive Guide by David Flanagan
This book is the holy bible of JavaScript, and contains pretty much all the information you will ever need to know. It’s an old book that was released back in 2006, a new version came out in 2011, which still makes this book old. Only reason I believe someone should read this book is if they want a good roadmap of the different topics to learn. The table of contents is great for someone wanting to know what they don’t already know. It has a very comprehensive list of almost all the essential topics in JavaScript. For interview preparation, and in general, I would not suggest for anyone to read this book cover to cover. Use it as a reference or a roadmap to topics that you have no recollection of.
5. JavaScript, Data Structures and Algorithms
JavaScript, Data Structures and Algorithms by Sammie Bae. I recently bought this book for myself as an early Christmas gift. This book is great for anyone needing a reference to all the computer science fundamentals like data structures and algorithms. If you are someone who is interviewing with big tech companies in Silicon Valley, and your main language is JavaScript, then pick this book up. This book helped me a bunch because there are not that many data structures and algorithms books that are purely written in JavaScript. This covers pretty much all that you can think of in terms of data structures and algorithms. So concepts like linked lists, trees, graphs, hash maps, etc.. Also, algorithms like depth first search, breadth first search, and sorting algorithms like bubble sort, merge sort, and many more. Even if you are not interviewing for specific Silicon Valley-based companies, I still recommend reading this book.
6. Eloquent JavaScript
Now here is a book that I wish I owned a physical copy to. Eloquent JavaScript is similar to Secrets of the JavaScript Ninja. It covers a broad range of topics. So concepts such as functions, strings, arrays, async programming, and the DOM are all included in this book. The author, Marijn Haverbeke also does a great job including figures and diagrams to help facilitate the readers' understanding of the topics being presented. The 3 things I really like about this books are how Marijn Haverbeke was able to apply the concepts learned in this book to projects. For example, chapter 12 was about building your own programming language. Another aspect that I really liked was how he emphasized the client/browser side of JavaScript. Chapters 13 to 19 were all about the browser, the DOM, handling events, and building projects to reinforce what you learned. Lastly, what I liked is how Marijn Haverbeke briefly touched on NodeJS, although it was only one chapter, it covered the topic well. For interview preparation, I recommend reading this book as a supplement and not as a main source of learning core JavaScript concepts. It’s by no means a hard read, but I think you would be better off reading this book if you wanted to build a project rather than study for interviews.
7. Effective JavaScript
And the last book… Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript by David Herman. It’s an advanced javascript cookbook with 68 tips on how to use the language. The book is about building on the basics and really using all your knowledge of JavaScript and putting them into good use. Some of my favourite learnings from this book were:
- Item 2: Understand JavaScript’s Floating-Point Number
- Item 18: Understand the Difference between Function, Method, and Constructor Calls
- Item 30: Understand the Difference between prototype, getPrototypeOf, andproto
This was definitely not an easy read for me, for it really dives deep into some of the intricacies of the language and advanced ways to use JavaScript to its full potential. I can definitely see you earning brownie points during an interview if you read and understood this book.
Conclusion
To conclude, if I had to pick my favourite book, which would it be? It would be Kyle Simpson's You Don't Know JS Series, more specifically, this & Objects Prototypes. It is because this was the book that ultimately made me understand how the object system works in JavaScript. If you own the physical copy, make sure to check out page 123 where Kyle explains the entire prototype and inheritance system in an easy-to-understand diagram.
Now the question is, which is your favourite JavaScript book of all time?