Promises in JavaScript allow for asynchronous code to be executed and handled when the response is sent to the caller.

Additionally, promises allow for handling when an error is thrown within the promise, and when the promise has completed its execution.

myPromise.then(() => {
    console.log("Promise was successful");
}).catch(() => {
    console.log("Promise was unsuccessful");
}).finally(() => {
    console.log("Promise completed");
});