---
title: "How to handle the result of a resolved Promise?"  
description: "How to handle the result of a resolved Promise?"  
author: "Revati S Misra"  
published: 2023-09-26  
updated: 2023-09-26  
canonical: https://www.mindstick.com/forum/159913/how-to-handle-the-result-of-a-resolved-promise  
category: "javascript"  
tags: ["javascript", "promise"]  
reading_time: 2 minutes  

---

# How to handle the result of a resolved Promise?

How to [handle](https://www.mindstick.com/articles/311004/suede-skillet-handle-cover) the [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) of a resolved [Promise](https://www.mindstick.com/forum/158328/what-is-a-promise-in-javascript-and-how-do-you-use-it)?

## Replies

### Reply by Aryan Kumar

To handle the result of a resolved Promise in JavaScript, you can use the **.then()** method. The **.then()** method allows you to specify a callback function that will be executed when the Promise is resolved successfully (i.e., in the fulfilled state). Here's how you can handle the result of a resolved Promise:

```plaintext
const myPromise = new Promise((resolve, reject) => {
  // Simulate a successful asynchronous operation
  setTimeout(() => {
    resolve("Operation succeeded!"); // Resolve the promise with a result
  }, 2000);
});

myPromise.then((result) => {
  // This function will be called when the Promise is resolved successfully
  console.log("Success:", result);
});
```

In this example, when **myPromise** is resolved (after a 2-second delay), the **.then()** method's callback function is called, and you can access the resolved value (in this case, the string "Operation succeeded!") as the **result** parameter within the callback.

You can also chain multiple **.then()** methods together for handling multiple asynchronous operations in sequence or for creating more complex Promise chains.

Here's an example with chaining:

```plaintext
const promise1 = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve("First operation succeeded!");
  }, 2000);
});

const promise2 = promise1.then((result) => {
  console.log("First Promise Result:", result);
  // You can return a new Promise or a value here
  return "Second operation succeeded!";
});

promise2.then((result) => {
  console.log("Second Promise Result:", result);
});
```

In this chained example, the second **.then()** handler is called with the result of the first Promise, and you can continue processing or returning new Promises as needed. This chaining mechanism is one of the strengths of Promises in managing complex asynchronous flows.


---

Original Source: https://www.mindstick.com/forum/159913/how-to-handle-the-result-of-a-resolved-promise

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
