Promise

noun

say it: “PROM-is” /ˈprɒmɪs/

A JavaScript object for a result that isn't ready yet, which later succeeds with a value or fails with an error.

What is Promise in JavaScript?

Promise — An object representing the eventual fulfillment or rejection of an asynchronous operation.

const orderReady = new Promise(resolve => {
    resolve("Ready");
});

In a sentence

  • “fetch returns a Promise, so I await it before using the response.”

Level: Journeyman · More JavaScript terms at this level

Updated