loop every 5 seconds

Solutions on MaxInterview for loop every 5 seconds by the best coders in the world

showing results for - "loop every 5 seconds"
Sasha
08 Apr 2020
1for(var i = 0; i < 3; i++) {
2    (function(index) {
3        setTimeout(function() { alert(index); }, index*5000);
4    })(i);
5}