Expanded Library

Refactoring JavaScript Promises with Async/Await

What you'll learn

In this project, you'll learn how to refactor traditional JavaScript promises into ones using Async/Await. You'll also learn how to use Promise.all() and Promise.race() successfully.

Table of contents

  • Set up your local environment for this project. We'll walk you through everything you need to know, including how to install and configure your environment to be able to complete all of the tasks.
Simulate a Fetch Call with setTimeout()
  • Learn how to use setTimeout() to simulate an asynchronous call.
Fetching Movies with a Traditional Promise
  • In this module, we will fill in the fetchMovies function in index.js.
Run Multiple Promises with Promise.all() and Promise.race()
  • Learn how to run promises in parallel with Promise.all() and Promise.race().
Make Async/Await Version of fetchMovies()
  • Have fetchMovies() use async/await syntax instead of traditional promises.
Make Async/Await Version of fetchBooks()
  • Have fetchBooks() use async/await syntax instead of traditional promises.
Create Async versions for Promise.all() and Promise.race()
  • Turn our functions utilizing Promise.all() and Promise.race() into async functions.
Enable Error Handling
  • In this module, you'll learn how to handle errors in promises.
Creating and Clearing Timers
  • Learn to create and clear timeouts created with setTimeout().
Ready to upskill? Get started