Foreword

Over the years, my employer has trusted me enough to conduct interviews. If we’re looking for someone with JavaScript skills, my first line of questioning…well, actually, is to check if the candidate needs the bathroom and/or a drink, because comfort is important. But once I’m past the bit about the candidate’s fluid intake/output, I set about determining if the candidate knows JavaScript, or just jQuery.

Not that there’s anything wrong with jQuery. It lets you do a lot without really knowing JavaScript, and that’s a feature—not a bug. But if the job calls for advanced skills in JavaScript performance and maintainability, you need someone who knows how libraries such as jQuery are put together. You need to be able to harness the core of JavaScript the same way they do.

If I want to get a picture of someone’s core JavaScript skill, I’m most interested in what they make of closures (you’ve read the You Don’t Know JS: Scope & Closures title of this series already, right?) and how to get the most out of asynchronicity, which brings us to this book.

For starters, you’ll be taken through callbacks, the bread and butter of asynchronous programming. Of course, bread and butter does not make for a particularly satisfying meal, but the next course is full of tasty, tasty Promises!

If you don’t know Promises, now is the time to learn. Promises are now the official way to provide async return values in both JavaScript and the DOM. All future async DOM APIs will use them, and many already do, so be prepared! At the time of writing, Promises have shipped in most major browsers, with IE shipping soon. Once you’ve finished savoring Promises, I hope you left room for the next course, Generators.

Generators snuck their way into stable versions of Chrome and Firefox without too much pomp and ceremony, because, frankly, they’re more complicated than they are interesting. Or, that’s what I thought until I saw them combined with Promises. There, they become an important tool in readability and maintenance.

For dessert, well, I won’t spoil the surprise, but prepare to gaze into the future of JavaScript! This book covers features that give you more and more control over concurrency and asynchronicity.

Well, I won’t block your enjoyment of the book any longer—on with the show! If you’ve already read part of the book before reading this foreword, give yourself 10 asynchronous points! You deserve them!

Get You Don't Know JS: Async & Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.