problem description
read a piece of promise source code
I don"t understand this paragraph very much
js
final value received when function resolve (value) {/ / value is successful
if(value instanceof Promise) {
return value.then(resolve, reject);
}
}
what result do you expect? What is the error message actually seen?
The resolvePromise function inpromise has not passed
.if (x instanceof Promise)
else if (x! = null & & ((typeof x = "object") | | (typeof x =" function"))
Why do you want to judge whether value is promise when it comes to resolve