~/JavaScript/Promises: Behind the Scenes

Promises in JavaScript have a reputation: daunting, confusing, sometimes infuriating.

But once you see what happens under the hood, they stop being magic. There's no clever runtime trick. Just a small object with a handful of internal slots and a queue.

Let's walk through it.

tap to continue