0
function x(){ for(var i = 1; i<=5; i++) { setTimeout(function (){ console.log(i); }, i * 1000); }
What is the output?
3 Respostas
+ 2
Similar problem, if you seek explanation
https://www.sololearn.com/Discuss/2617149/?ref=app
0
Tell me output
0
harsh tiwari if you just want the output, you can run it yourself in the Code Playground. You don't need to ask a question for that. If you want to know the reason for why the output is like that, then Rei already linked a webpage in his answer.