# one **Repository Path**: hanfengmi/one ## Basic Information - **Project Name**: one - **Description**: 每天面试题整理 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # one ## 08-11 JS异步执行,宏任务+微任务 写出下列代码输出结果 ``` console.log("AAAA"); setTimeout(() => console.log("BBBB"), 1000); const start = new Date(); while (new Date() - start < 3000) {} console.log("CCCC"); setTimeout(() => console.log("DDDD"), 0); new Promise((resolve, reject) => { console.log("EEEE"); foo.bar(100); }) .then(() => console.log("FFFF")) .then(() => console.log("GGGG")) .catch(() => console.log("HHHH")); console.log("IIII"); // 打印 AAAA,CCCC,EEEE,IIII,HHHH,BBBB,DDDD ```