JAVASCRIPT Study Guide - Midterm Guide: Source Code Editor

10 views2 pages
3 May 2023
Department
Professor

Document Summary

We"ll take a basic example and convert it to promises to show you how to use them. We"ll also discuss th e different phases of a promise, how to handle errors, and how to chain multiple promises together. Synchronous code blocks the execution of any line that comes after it, whereas asynchronous code does not. We want our code to run smoothly and quickly, so we need to use asynchronous code. Using promises makes our code more reusable and useful. We can use them to fetch data from apis and manipulate it without blocking the execution of other code. Decoupling functions with callbacks makes our code more modular and easy to reuse. We can pass differ ent functions to a callback and it still works. When working with promises in code, there are two parts involved: the maker and the receiver.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions