JavaScript | JavaScript Operators | Question 6

Last Updated :
Discuss
Comments

Find the output of the following.

for (var i = 0; i < 3; i++) {

setTimeout(function() {

console.log(i); }, 100);

}

ReferenceError

3 3 3

0 1 2

undefined undefined undefined

Share your thoughts in the comments