1. Let const vs. var

  • varThere’s a variable promotion,letandconstNo variable promotion
  • letConst is a constant
  • constWhen you assign an object or array, the value of the object or array can be changed,constPointers are guaranteed to stay the same (values are not guaranteed to stay the same)
  • let const Variables are block-level scopes
  • let constVariables cannot be repeated
  • let constIt creates a temporary dead zone

2. Elaborate on promises

  1. Because traditional asynchrony results by going back to a function, the promise was invented to address the callback hell that leads to bad code readability and maintenance costs

  2. We promise we can make a promise. We promise we can make a promise. We promise we can make a promise.

  3. In the promise,the prototype method then catch catch does not have all errors. Then performs state changes and then returns a new promise. Then can also perform the next PRMISE task. Support. Then performs multiple asynchronous tasks through chain calls

  4. The new Promise function is executed synchronously. The then function is executed asynchronously

  5. Static methods on Promise: All Race resolve Reject, etc

    • allProcessing concurrent business, all successful execution then
    • raceOne of the multiple promises successfully implements then
    • resolveChanges the state to completed
    • rejectChange the status to rejected

3. The ones that promise are asynchronous and the ones that promise are synchronous

The new Promise function is synchronization

The.then. catch function is asynchronous

4. How to solve the problem of poor readability of callback hell code

promise

5. Talk about your understanding of Async aWIat

1: Async function returns the value proMIE instance

2: await can only be used in async

Awati: Async awati, a awati program

4: Await is followed by a Promise instance

– async returns —-> await return value return

-new Promise —–> await return value resolve argument

-then returns the promise —-> await return of the function in then

6. Talk about the function of class

Is a new class type in ES6

  1. Objects can be instantiated

  2. Extends inheritance

  3. Constructor when the class class is executed; Trigger constructor dog paw maple

  4. Super triggers the constructor in the parent class

  5. The static keyword can define static properties and static methods of a class

7. How do you use super in class

  1. Triggers the parent class’s constructor
  2. Call a static method of the parent class in a subclass

8. What does the ES6 object extension have

  1. Deconstruction assignment

  2. Short for object property

  3. Extended operator

9. What are the features of the arrow function

  1. Change the anonymous function to the arrow function

  2. No this uses this from the previous layer

  3. No arguemets use rest arguments instead

10. What is the evolution of asynchronous programming languages?

Callback functions --> promise -->generator ---->async await