Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: a0e16ccd5e
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (25 sloc) 0.357 kB
**question
What is the result of the following code?
**question
**code
function timeoutLoop() {
for(var it = 0; it < 2; it++)
{
setTimeout(function(cur) {
return function() {
console.log(cur);
}
}(it), 1);
}
}
timeoutLoop();
**code
**possibleAnswers
0, 1
1, 2
2, 2
2, 3
**possibleAnswers
**correctIndex
0
**correctIndex
Jump to Line
Something went wrong with that request. Please try again.