JavaScript Promise Reference Last Updated : 18 Apr, 2025 Comments Improve Suggest changes Like Article Like Report JavaScript Promise is used to handle asynchronous operations JavaScript. They are easy to manage when dealing with multiple asynchronous operations where callbacks can create callback hell leading to unmanageable code. Promises are the ideal choice for handling asynchronous operations in the simplest manner. They can handle multiple asynchronous operations easily and provide better error handling than callbacks and events.SyntaxPromise.function();Example: JavaScript // Illustration of Promise.allSettled() // Method in Javascript with Example const p1 = Promise.resolve(50); const p2 = new Promise((resolve, reject) => setTimeout(reject, 100, 'geek')); const prm = [p1, p2]; Promise.allSettled(prm) .then((results) => results.forEach((result) => console.log(result.status,result.value))); Output:"fulfilled"50"rejected" undefinedThe complete list of JavaScript Promise is listed below:JavaScript Promise Constructor: In JavaScript, a constructor gets called when an object is created using the new keyword.ConstructorDescriptionPromiseHandle asynchronous operations in JavaScript.JavaScript Promise Properties: A JavaScript property is a member of an object that associates a key with a value.Instance Property: An instance property is a property that has a new copy for every new instance of the class.Instance PropertiesDescriptionconstructorReturn the promise constructor function for the object.JavaScript Promise Methods: JavaScript methods are actions that can be performed on objects.Static Method: If the method is called using the array class itself then it is called a static method.Static MethodsDescriptionall()Handle all the asynchronous operations), that take an array of promises(an iterable) as input.allSettled()Get a promise when all inputs are settled that is either fulfilled or rejected.any()Return a single promise that fulfills with the value from that promise.race()Returns a single Promise after receiving an iterable of promises as input.reject()Returns a Promise object that is rejected with a given reason.resolve()Returns a Promise object that is resolved with a given value.Instance Method: If the method is called on an instance of a promise then it is called an instance method.Instance MethodsDescriptioncatch()The return value of the callback if it is called.then()Deal with asynchronous tasks such as API calls.finally()Return a Promise when a Promise is settled, that is, it is either fulfilled or rejected. Comment More infoAdvertise with us Next Article JavaScript Promise Reference K kartik Follow Improve Article Tags : JavaScript Web Technologies Promise Similar Reads JavaScript Object Reference JavaScript Objects are the most important data type and form the building blocks for modern JavaScript. The "Object" class represents the JavaScript data types. Objects are quite different from JavaScriptâs primitive data types (Number, String, Boolean, null, undefined, and symbol). It is used to st 4 min read JavaScript Promise JavaScript Promises make handling asynchronous operations like API calls, file loading, or time delays easier. Think of a Promise as a placeholder for a value that will be available in the future. It can be in one of three statesPending: The task is in the initial state.Fulfilled: The task was compl 4 min read JavaScript promise reject() Method The Promise.reject() method is used to return a rejected Promise object with a given reason for rejection. It is used for debugging purposes and selective error-catching. The catch() method can be used for logging the output of the reject() method to the console that is catch() method acts as a care 3 min read JavaScript Promise race() Method The Promise.race() method returns a promise that fulfills or rejects as soon as one of the promises in an iterable fulfills or rejects, with the value or reason from that promise. We may think of this particular method as in the form of a real-life example where several people are running in a race 2 min read JavaScript Promise then() Method JavaScript Promise then() method is called whenever a promise is resolved. It takes data from the resolved promise. It can take up to two arguments which are callback functions for the fulfilled and rejected cases respectively. Just like the catch() method it also returns a Promise so it is used to 2 min read Like