Promise executor
2022年5月1日小于 1 分钟
Promise executor
Question
What does the code snippet to the right output by console.log
?
Snippet
new Promise((resolve, reject) => {
resolve(1)
resolve(2)
reject('error')
}).then((value) => {
console.log(value)
}, (error) => {
console.log('error')
})