看看有多少人中枪,你能说出这段程序执行是怎样的吗?
let count = 1
let wait = new Promise(resolve => {
setTimeout(() => {
resolve(count++)
}, 1000)
})
const fn = () => {
return wait.then(console.log)
}
fn()
.then(fn)
.then(fn)
提示一下:wait 不是一个工厂函数哟。
let count = 1
let wait = new Promise(resolve => {
setTimeout(() => {
resolve(count++)
}, 1000)
})
const fn = () => {
return wait.then(console.log)
}
fn()
.then(fn)
.then(fn)
提示一下:wait 不是一个工厂函数哟。