SyntaxFix
Write A Post
Hire A Developer
Questions
You could use bind method
bind
for (var i = 1, j = 1; i <= 3; i++, j++) { setTimeout(function() { alert(this); }.bind(i), j * 100); }