Josh Comeau does a great job with beginner-friendly explanations of important concepts, and Promises From The Ground Up is no exception. In a nutshell, we have Promises because we need callbacks. We need callbacks because JavaScript is single-threaded and can’t wait around for things. And so we dance. These days, you’ll see more async
and await
, but it’s just what they call “syntactic sugar” over Promises, which is to say, a cleaner way to write the same code.
Will Sentance goes deep into Promises in JavaScript: The Hard Parts when you’re ready.