之前在网上看到一道Promise执行顺序,这道题目是这样的: 打印以下程序的输出: new Promise(resolve => { console.log(1); resolve(3); }).then(num => { console.log(num) }); console.log(2) 这道题的输出是123,为什么不是13...
之前在网上看到一道Promise执行顺序,这道题目是这样的: 打印以下程序的输出: new Promise(resolve => { console.log(1); resolve(3); }).then(num => { console.log(num) }); console.log(2) 这道题的输出是123,为什么不是13...