DEV Community

Shashi Bhushan Kumar
Shashi Bhushan Kumar

Posted on

.then() vs async/await — Very Simple Real-Life Explanation

Real-life situation

Your girlfriend says to you:
“Call me when you reach home.”
You say:
“Okay, I will call you.”
Now you are on the way to home.

Case1: Using .then() (Too many steps in mind)
You keep thinking like this:
First, I will reach home
Then, I will unlock my phone
Then, I will open the calling app
Then, I will call her
Everything works,
but you have to think about every step one by one.
This is how .then() works in JavaScript.
It does the job, but the flow feels a little messy.

Case 2: Using async/await (Natural and calm)
This time you think only one thing:
“After I reach home, I will call her.”
You don’t think about steps.
You just wait until you reach home.
Then you call her.
Simple.
No extra thinking.
This is how async/await works.

What is the real difference?
.then()
Works fine
But code can look confusing when steps increase
async/await
Does the same work
But code looks like a simple story.

One very important truth
async/await is not a new thing.
It is just a cleaner way to write Promises.

Behind the scenes,
JavaScript is still using Promises.
One-line summary (remember this)
.then() works, but async/await feels natural — like real life.

One Very Simple Example.
async function reachHome() {
await goHome();
callGirlfriend();
}

What do you use in real projects?
👉 .then()
👉 or async/await?

Top comments (0)