1.What is a promise?
2. What is callback hell?
●Callback hell is actually caused by too many nested callback functions.
3. Basic use of promise
Promise is an es6 syntax. When we create a new promise, we need to pass a callback function, which is executed immediately. Call it (executor)
For this callback function, we need to pass in two parameters reslove reject
When the reslove function is executed, the .then of the promise object will be called back The function .then function can receive both success and failure When the reject function is executed, the .catche function of the promise object will be called back
4.promise three states
5.promise result
The result returned after the request succeeds or fails
6.Promise resolve method
7.promise reject method
8.promise.all method
9.promise.race method
10.promise.allSettled method
11.promise.any
---------------------Finished with flowers! ! ! If you find anything useful, please give it a like! !