DEV Community

Gayathri.R
Gayathri.R

Posted on

What is promise in Javascript

a Promise is a JavaScript object representing the eventual completion or failure of an asynchronous operation, like fetching data from a server or reading a file. It provides a way to handle these "eventual" outcomes, allowing developers to write cleaner, more readable, and more organized asynchronous code by avoiding "callback hell". A Promise object can be in one of three states: pending, fulfilled (resolved), or rejected.

Top comments (0)