We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for (let i = 0; i < 10000000000; i++) { console.log(i) }
// 第一步:定义变量 let a = 1; // 第二步:发出指令,然后把回调函数加入异步队列(回调函数并没有执行) setTimeout(() => { console.log(a); }, 0) // 第三步:赋值,回调函数没有执行 a = 2; // 第四步:发出指令,然后把回调函数加入异步队列(回调函数并没有执行) setTimeout(() => { console.log(a); }, 0) // 第五步:赋值,回调函数没有执行 a = 3; // 当所有代码执行完毕,cpu空闲下来了,就会开始执行异步队列里面的回调函数 // 所以最后控制台输出:3 3
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Node.js 擅长与不擅长的
擅长
不擅长
什么是异步
The text was updated successfully, but these errors were encountered: