获得徽章 0
干后端的前端 @程序制造386厂
求解答node event loop
new Promise(function (resolve) {
console.log("1");
resolve();
}).then(function () {
console.log("2");
process.nextTick(() => {
console.log("x");
});
new Promise(function (resolve) {
console.log("3");
resolve();
}).then(function () {
console.log("4");
});
setTimeout(function () {
console.log("5");
});
});
结果:node 15.6
1 2 3 4 x 5
没想明白 process.nextTick 怎么在 4 后面[流泪]
展开
1
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
干后端的前端 @程序制造386厂
下一页
个人成就
文章被阅读 732
掘力值 60
收藏集
17
关注标签
102
加入于