Running the Code Examples

This book is a bit unusual, in that I discuss both client-side (browser) and server-side (Node.js) code. That reflects the uniquely portable nature of JavaScript. The central concepts apply to all JavaScript environments, but certain examples are aimed at one or the other.

Even if you have no interest in writing Node applications, I hope you’ll follow along by running these code snippets locally. See ​Running Code in Node.js​ for directions.

Which Examples Are Runnable?

When you see a code snippet with a filename, that means it’s self-contained and can be run without modification. Here’s an example:

Preface/stringConstructor.js
​ 
console.log(​'str'​.constructor.name);

The surrounding context should ...

Get Async JavaScript 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.