Gopinath
May 10, 2026
Before you reach for Express, try building a simple API with just Node's built-in http module. You'll learn a ton.
Most tutorials throw you into syntax before you understand the problem being solved. That's like learning to drive by memorizing the gear positions before you've ever sat in a car. Let's fix that.
The real question isn't "how does this syntax work?" — it's "what problem does this solve, and why did we need a new solution?"
Think of your JavaScript program as a restaurant kitchen. The chef (your main thread) can only do one thing at a time. When an order comes in that takes a long time — say, a slow database query — you don't want the chef to just stand there waiting.
// The old way — callback hell
fetchUser(userId, function(user) {
fetchPosts(user.id, function(posts) {
fetchComments(posts[0].id, function(comments) {
// You're now three levels deep 😅
console.log(comments);
});
});
});
// The async/await way — reads like normal code
async function loadData(userId) {
const user = await fetchUser(userId);
const posts = await fetchPosts(user.id);
const comments = await fetchComments(posts[0].id);
console.log(comments); // Clean!
}Pro tip
If you find yourself writing .then().then().then(), that's a sign you should switch to async/await. Your future self will thank you.
Async/await isn't magic — it's just a cleaner way to write Promise-based code. Once that clicks, the syntax becomes obvious. Start with the mental model, then the syntax will follow naturally.
Got questions? Drop a comment below — I read every single one.
Got a question, a thought, or something to add? I'd love to hear it.