You can use a counter, it's complicated, but worth it if you are working with objects:
counter = 0; $.each(object, function(index,item){ counter++; var localCounter = counter; setTimeout(function{ console.log('something') }, counter * 1000)
The first counter is global, so if we are not a var localCounter , we will execute all timeouts at the same time.
mate.gwozdz
source share