JavaScript Promises are a new addition to ECMAscript 6 that aims to provide a cleaner, more intuitive way to deal with the completion (or failure) of asynchronous tasks. ES6 came with many new features, but one of the best features was the official introduction of Promises. In essence, a Promise in JavaScript is a lot like a promise made in real life. The methods promise.then(), promise.catch(), and promise.finally() are used to associate further action with a promise that becomes settled. How to Align modal content box to center of any screen? To e x plore this further, let’s take a look at how a small child promising his parents to clean his room looks like in JavaScript. Please use ide.geeksforgeeks.org, close, link .catch() is just a shorthand for .then(null, errorHandler) ). The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value. Note: A promise is said to be settled if it is either fulfilled or rejected, but not pending. A Promise in JavaScript is an object which returns a result after an asynchronous operation has finished. // It doesn't have to be a string, but if it is only a succeed message, it probably will be. To illustrate this a bit further we can take a look at how an