Junior — Senior
What will console.log print in this example
livecode
Task condition
Determine which numbers will appear in the output after executing the following JavaScript code:
for (var idx = 0; idx < 10; idx++) {
setTimeout(function () {
console.log(idx);
}, 1000);
}