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 (var i = 0; i < 5; i++) { console.log(i); }
for (var i = 0; i < 5; i++) { setTimeout(function() { console.log(i); }, 1000 * i); }
for (var i = 0; i < 5; i++) { (function(i) { setTimeout(function() { console.log(i); }, i * 1000); })(i); }
for (var i = 0; i < 5; i++) { (function() { setTimeout(function() { console.log(i); }, i * 1000); })(i); }
for (var i = 0; i < 5; i++) { setTimeout((function(i) { console.log(i); })(i), i * 1000); }
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);
知乎上看到的文章,六道题循序渐进的考察了很多东西.
做完了感觉有用就去原作者处点个赞吧. 作者:Liril
The text was updated successfully, but these errors were encountered:
这几题主要考察了闭包还有js异步的知识,贴一下关于闭包的,https://www.zhihu.com/question/33468703
Sorry, something went wrong.
No branches or pull requests
知乎上看到的文章,六道题循序渐进的考察了很多东西.
做完了感觉有用就去原作者处点个赞吧.
作者:Liril
The text was updated successfully, but these errors were encountered: