Asynchronous JavaScript
Overview
Asynchronous programming is crucial for handling tasks like fetching data from servers, making API requests, or performing time-consuming operations without blocking the main execution thread.
The objective of this learning activity is to
- Understand the basics of asynchronous programming in JavaScript.
- Learn how to use the
async
function andawait
keyword to manage asynchronous operations. - Explore error handling mechanisms with
try...catch
blocks in asynchronous functions. - Practice using async and await with real-world examples.
"Asynchronous programming is a technique that enables your program to start a potentially long-running task and still be able to be responsive to other events while that task runs, rather than having to wait until that task has finished. Once that task has finished, your program is presented with the result." - MDN
Prepare
- Read: Asynchronous JavaScript - MDN
- Watch Video: JavaScript Async/Await - Bro Code
- Reference: async Function - MDN
- Reference: Await - MDN
- Reference: try...catch block - MDN
Optional Resources
- Asynchronous Programming - Eloquent Javascript