for (var i = 0; i < 10; i++) { | |
function timer(j) { | |
setTimeout(function() { | |
console.log(j); | |
}, j*1000); | |
}; | |
timer(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for (var i = 0; i < 10; i++) { | |
function timer(j) { | |
setTimeout(function() { | |
console.log(j); | |
}, j*1000); | |
}; | |
timer(i); | |
} |