<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/promise-internals-cz7d3anvx" -->

---
title: Promise Internals | daily.dev
description: Discussion about "Promise Internals" on daily.dev - join the developer community
canonical: https://daily.dev/posts/promise-internals-cz7d3anvx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Promise Internals | daily.dev
og:description: Discussion about "Promise Internals" on daily.dev - join the developer community
og:url: https://daily.dev/posts/promise-internals-cz7d3anvx
og:image: https://api.daily.dev/og/posts/cZ7D3anvx.png
og:image:alt: Promise Internals
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Promise Internals

**[navya](https://daily.dev/sources/dlrmprw88mjnbukqs8t0w)** · [@navyaak](https://daily.dev/navyaak) · 0 upvotes · 0 comments

## Content

console.log("A");

new Promise(() => {

console.log("B");

});

console.log("C");

Take a guess before scrolling 👇

.

.

.

.

.

.

.

.

.

.

.

The output is...

A

B

C

### But WHY?

A common misconception is:

“Since it's a Promise, the code inside it runs asynchronously.”

**Nope! ❌**

The function passed to `new Promise()` — called the **executor** — runs **synchronously**.

You can think of it similarly to a normal function call:

```
function doSomething(callback) {
  callback();
}

console.log("A");

doSomething(() => {
  console.log("B");
});

console.log("C");
```

Output:

```
A
B
C
```

The same idea applies to the Promise executor:

```
new Promise((resolve, reject) => {
  // This runs immediately
});
```

So the execution is:

```
new Promise()
      ↓
executor runs immediately
      ↓
console.log("B")
      ↓
continue execution
      ↓
console.log("C")
```

**The Promise itself doesn't make the executor asynchronous.**

What makes an operation asynchronous is usually the API you use _inside_ the executor, such as:

```
setTimeout(...)
fetch(...)
```

For example:

```
console.log("A");

new Promise((resolve) => {
  console.log("B");

  setTimeout(() => {
    console.log("C");
    resolve();
  }, 1000);
});

console.log("D");
```

Output:

```
A
B
D
C
```

Because the executor is still synchronous — only the `setTimeout` callback is asynchronous.

**Remember:**

`new Promise(executor)` → executor runs synchronously
`.then(callback)` → callback runs asynchronously as a microtask

Understanding this distinction makes the JavaScript event loop and Promise behavior much easier to reason about.

---

[View this post on daily.dev](https://daily.dev/posts/promise-internals-cz7d3anvx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/promise-internals-cz7d3anvx","headline":"Promise Internals","text":"Discussion about \"Promise Internals\" on daily.dev - join the developer community","url":"https://daily.dev/posts/promise-internals-cz7d3anvx","datePublished":"2026-09-03T18:03:13.458Z","dateModified":"2026-09-03T18:03:13.458Z","author":{"@type":"Person","name":"navya","url":"https://daily.dev/navyaak","image":"https://media.daily.dev/image/upload/s--vM6dTj_h--/f_auto/v1788852968/avatars/avatar_DLRmpRw88MjNBUKqs8T0W?_a=BAMAMicg0","description":"Software Engineer","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":420}},"image":"https://media.daily.dev/image/upload/s--y2Ws1PJ0--/f_auto/v1788458594/posts/cZ7D3anvx?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/dlrmprw88mjnbukqs8t0w","name":"navya"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"navya","item":"https://daily.dev/sources/dlrmprw88mjnbukqs8t0w"},{"@type":"ListItem","position":3,"name":"Promise Internals"}]}
```

