1. 同步代码执行顺序优先级高于异步代码执行顺序优先级;
2. new Promise(fn)中的fn是同步执行;
3. process.nextTick()>Promise.then()>setTimeout>setImmediate
出处:https://www.jb51.net/article/151174.htm
2024-02-10 19:47:58
1. 同步代码执行顺序优先级高于异步代码执行顺序优先级;
2. new Promise(fn)中的fn是同步执行;
3. process.nextTick()>Promise.then()>setTimeout>setImmediate
出处:https://www.jb51.net/article/151174.htm