异步编程: Promise 题目 1 - 1
Opened this issue · 0 comments
leslie1943 commented
Promise 题目 - 1
const promise1 = new Promise((resolve, reject) => {
console.info('promise1')
})
console.info('1', promise1)
过程分析
- 从上到下, 先遇到
new Promise
, 执行该构造函数中的代码promise1
- 然后执行同步代码
1
, 此时promise1
没有被resolve
或者reject
,因此状态还是pending