when reading Promise :
var promise1 = new Promise(function(resolve, reject) {
setTimeout(resolve, 100, "foo");
});
if an error is thrown in the executor function, the promise state is rejected. The return value of the executor function is ignored.
how do you understand the return value of the executor
function here?
isn"t Promise supposed to be resolve
or reject
to execute parameter passing? What is Promise"s executor
?