# Promises and Async Await in JavaScript
Before Promises, asynchronous JavaScript relied on nested callbacks — often called "callback hell." Promises, and later `async/await`, made async code far more readable.
## What a Promise Represents
A Promise is an object representing a value that may not be available yet. It has three states: pending, fulfilled, or rejected.
```javascript
const fetchUser = () =>
new Promise((resolve, reject) => {
setTimeout(() => resolve({ name: "Aarav" }), 1000);
});
```
## Chaining with .then()
```javascript
fetchUser()
.then((user) => console.log(user.name))
.catch((err) => console.error(err));
```
Chaining avoids nested callbacks but can still get messy with multiple sequential steps.
## async/await Syntax
`async/await` is syntactic sugar over Promises that lets asynchronous code read like synchronous code:
```javascript
async function loadUser() {
try {
const user = await fetchUser();
console.log(user.name);
} catch (err) {
console.error(err);
}
}
```
## Running Requests in Parallel
A common mistake is `await`-ing requests one after another when they don't depend on each other. Use `Promise.all` instead to run them concurrently:
```javascript
const [user, orders] = await Promise.all([fetchUser(), fetchOrders()]);
```
## Error Handling
Every `await` call should be wrapped in `try/catch`, or the surrounding function should handle rejected promises explicitly — unhandled rejections are a common source of silent bugs in production.
## Conclusion
`async/await` doesn't replace Promises — it's built on top of them. Understanding both together makes real-world API calls, database queries, and file operations far easier to write correctly.
Back to Blogs
Promises and Async Await in JavaScript
How Promises work under the hood, and how async/await makes asynchronous JavaScript code easier to read and debug.
12 Aug 2026
6 min read