so consider the code below, when I resolve a promise
the result is in pending
state in the very first moment( I know after I expand the dropdown I will see the expected result but in here I m questioning the very first moment), while I reject a promise, it shows the expected result in very first moment. so I wonder why is this happening?
法典:
const test = new Promise((resolve, reject) => {
resolve(Promise.resolve(78))
})
console.log(test);
//output in console:Promise {<pending>}
const test2 = new Promise((resolve, reject) => {
reject(Promise.resolve(78))
})
console.log(test2);
//output:promise {<rejected>: Promise}