This is an example:
function func1()
{
setTimeout(function(){doSomething();}, 3000);
}
for(i=0;i<10;i++)
{
func1();
}
after executing
The for loop is running continuously so each call is 3000 millisecond of that call. Resulting in no delay between two calls. For better understanding, loop call func1 at time t and t + 1. So it will execute at t + 3000 and T + 3001 leaving no difference.
You can try below approach :-
function func1(i){
setTimeout(function(){doSomething();}, i * 3000);
}
for(i=i;i<=10;i++){
func1(i);
}
Note:- Loop intialized with i = 1.