Use Promises over Callbacks, and How to Create a New Promise in Javascript

Sherlynn Tan
Aug 18, 2019 · 2 min read

Promises are widely used instead of callbacks. Promises are a great feature in Javascript that enable you to avoid callback hell, especially when you need to wait on a response from multiple API requests that are asynchronous.

A Promise is a special Javascript object that represents the eventual result of an asynchronous action. A promise…