MCQs > IT & Programming > JavaScript > What's the output? for (var i = 0; i < 5; i++) { (function(x) { setTimeout(function() { console.log(x); }, x * 1000 ); })(i); }

JavaScript MCQs

What will be the output of the following code: for (var i = 0; i < 5; i++) { (function(x) { setTimeout(function() { console.log(x); }, x * 1000 ); })(i); }

Answer

Correct Answer: 0 1 2 3 4

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it