---
title: "Discussion on \"The Most Important Thing You Don't Know About Promises\" | Hashnode"
description: "Discussion on \"The Most Important Thing You Don't Know About Promises\". Take a look at the below code:\nconst promise = new Promise((resolve, reject) => {\n  resolve();\n});\n\npromise\n  .then(() => {\n    console.log('first');\n  })\n  .then(() => {\n    console.log('second');\n  })\n  .then(() => {\n    console.log('third');\n  })\n..."
url: "https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Most Important Thing You Don't Know About Promises](https://blog.yogeshchavan.dev/the-most-important-thing-you-dont-know-about-promises?utm_source=hashnode&utm_medium=feed)

Take a look at the below code: const promise = new Promise((resolve, reject) => { resolve(); }); promise .then(() => { console.log('first'); }) .then(() => { console.log('second'); }) .then(() => { console.log('third'); }) ...

Jun 22, 2021 · 3 min read · blog.yogeshchavan.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)
-   [#nodejs](https://hashnode.com/tag/nodejs)

## Written by

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97)

@myogeshchavan97 · India

  
[View profile](https://hashnode.com/@myogeshchavan97)

Full Stack Developer | Freelancer | JavaScript | React | Nodejs. https://yogeshchavan.dev/. Book 1:1 @ hiretheauthor.com/myogeshchavan97

Full Stack Developer | Freelancer | JavaScript | React | Nodejs. Loves sharing knowledge through technical articles. Dev.to: https://dev.to/myogeshchavan97 https://linktr.ee/myogeshchavan97

## Responses 3

Markdown supported · ⌘↵ to post

[Himanshu Kumar](https://hashnode.com/@hkumar0132)

[Jun 28, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d9d09d703d372ea06c828c)

Great article. I have stuck in this problem before. I wonder if there's a way to solve this by using async-await instead of promises.

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97)

[Jun 28, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d9d09d703d372ea06c828c#reply-60d9d27c68364a2e7b2ce84b)

[Himanshu Kumar](https://hashnode.com/@hkumar0132) If you're using async/await, you don't need to worry about this problem because when using await keyword, the next line will not be executed until the promise we're awaiting for gets resolved/rejected.

[Himanshu Kumar](https://hashnode.com/@hkumar0132)

[Jun 28, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d9d09d703d372ea06c828c#reply-60d9da02703d372ea06c8384)

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97) That makes sense. Thanks for clarifying.

[SOIF RIWAJ](https://hashnode.com/@Soif)

[Jun 28, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d9631868364a2e7b2cd88d)

Awesome content. Thanks Yogesh! I was wondering as for API call we mostly use axios which also returns a Promise by default, we will not have to explicitly return a promise from inside a then block. Obviously for other use cases where things don't return promise we have to do the one you did. Please correct me if I am wrong.

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97)

[Jun 28, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d9631868364a2e7b2cd88d#reply-60d96785703d372ea06c71f8)

Thanks [SOIF RIWAJ](https://hashnode.com/@Soif).

Yes, for `axios` we don't need to deal with this issue most of the time. But If you're doing some asynchronous operation in the `.then` handler then you need to be aware of this issue.

[Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)

[Jun 22, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d1a362f668475d88fed06a)

Wow-some article as usual [Yogesh Chavan](https://hashnode.com/@myogeshchavan97), this is a refreshment for me 🤗, thanks a lot for sharing 😊

[Yogesh Chavan](https://hashnode.com/@myogeshchavan97)

[Jun 22, 2021](https://hashnode.com/posts/the-most-important-thing-you-dont-know-about-promises/60d19f79f668475d88fecfe5/comment/60d1a362f668475d88fed06a#reply-60d1a6e4a6a3a25dadf62c15)

Glad to hear that. Thanks for reading [Ayodele Samuel Adebayo](https://hashnode.com/@unclebigbay)
