Skip to content
New issue

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

以下代码输出什么? #638

Open
lgwebdream opened this issue Jul 6, 2020 · 4 comments
Open

以下代码输出什么? #638

lgwebdream opened this issue Jul 6, 2020 · 4 comments
Labels
JavaScript teach_tag 心娱 company

Comments

@lgwebdream
Copy link
Owner

setTimeout(function () {
  console.log(1);
}, 0);
new Promise(function executor(resolve) {
  console.log(2);
  for (var i = 0; i < 10000; i++) {
    i == 9999 && resolve();
  }
  console.log(3);
}).then(function () {
  console.log(4);
});
console.log(5);
@lgwebdream lgwebdream added JavaScript teach_tag 心娱 company labels Jul 6, 2020
@lgwebdream
Copy link
Owner Author

扫描下方二维码,获取答案以及详细解析,同时可解锁800+道前端面试题。

@zhouyonghuan
Copy link

2、3、5、1、4

@Genzhen
Copy link
Collaborator

Genzhen commented Dec 30, 2020

2、3、5、1、4

答案执行有错😯

@gaochongmax
Copy link

2、3、5、4、1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript teach_tag 心娱 company
Projects
None yet
Development

No branches or pull requests

4 participants