Member-only story
Callbacks vs. Promises in JavaScript
The difference can be confusing — let’s clear that up

If you’re new to JavaScript and have a hard time trying to understand how promises work, hopefully this article will assist you in understanding them more clearly.
With that said, this article is aimed at those who are a little unsure about promises.
This post won’t be going over executing promises using async/await (although they’re the same thing functionality-wise — only that async/await is more syntactic sugar for most situations).
The What
Promises were actually out for awhile even before they were native to JavaScript. For example, two libraries that implemented this pattern before promises became native is Q and when.
So what are promises? Promises are JavaScript objects that represent an eventual completion or failure of an asynchronous operation. You can achieve results from performing asynchronous operations using the callback approach or by using promises. But there are some minor differences between the two.
Key Difference Between Callbacks and Promises
A key difference between the two is when using the callback approach, we’d normally just pass a callback into a…