Callbacks vs Promises
Two ways to handle async code. Callbacks came first, Promises are cleaner.
Callback Pattern
Section titled “Callback Pattern”Pass a function to run when the async work is done:
Promise Pattern
Section titled “Promise Pattern”Returns an object you can chain with .then():
Async/Await
Section titled “Async/Await”Syntactic sugar over Promises - looks like sync code: