for (var i = 0; i < 10; i++) { setTimeout(function() { console.log(i); }, 1000); }
The 5 types of JS Developers I find in Interviews
Shyam Seshadri

This would not print from 0–9 instead it will print “10"(without quotes) 10 times because the loop will finish before. Please check:

A nice article though!

Have a nice day!! :)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.