promise

Resolve and reject are both functions.

The executor function is a synchronous callback function

then

Then is a method, a method of an instance object

The correct way to write it is p.teng

catch

The catch method is of the instance object

So promise.catch() is wrong

Catch is a callback function used to return a failure

Similar to the second callback function in p.Teng (()=>{},()=>{})

resolve

Methods are function objects, promise.resolve() is correct

Function: Converts a value to a Promise object

This is a big pity. Promise has three state values: fulfilled state

Rejected: Indicates the failed state

Pending: Indicates the pending status

PromiseState: This property is in the promise state

PromiseResult: This property is the result of a promise

The result value is not the same as the return value

reject

A method is the method of a function object, promise.reject()

Action: Converts a value to a failed promise object

Reject (reject) The final result is rejected

When the resolve and reject functions are called, the default state of promise is changed to fulfilled and Rejected, and the result value is changed to success or failure

Unfinished…