Member-only story

Why Async/Await Wins the Race Against Promise.then().catch()

Mertcan Arguç
4 min readJul 1, 2023

Table of Contents

  1. Introduction
  2. Improved Readability
  3. Ease of Error Handling
  4. Natural Coding Style
  5. Utilization of Modern JavaScript Features
  6. Enabling Better Code Structuring and Organization
  7. Integration with Promise-Based Features
  8. Conclusion

Introduction

Hello, young computer engineers! Today, I am going to tell you a story about the enchanting world of JavaScript. Fear not, as there are no dragons or wizards in this tale, but instead, two powerful and mesmerizing heroes: Promise.then().catch() and async/await. By the end of this story, you will have learned how these characters make our world more readable, more efficient, and more effective. Let’s get to know these heroes better and take a closer look at their advantages.

Improved Readability

Firstly, one of the main benefits of async/await is the increased readability of your code. Here’s an example to illustrate this:

Promise-based code:

function getData() {
return fetch('<https://api.example.com/data>')
.then(response…

No responses yet

Write a response