I have a loop that already has a delay like this
for (var i = 0; i < 100; i++) {
setTimeout( function (i) {
console.log("Hai")
}, 1000*i, i);
}
if using coding above it will be executed with a 1 second pause for 100 repetitions
here I want to add one more delay where if it reaches 5 times it will pause longer eg 30 seconds then continue again before the delay
example :
Hai .. delay 1 second
Hai .. delay 1 second
Hai .. delay 1 second
Hai .. delay 1 second
Hai .. delay 1 second
delay 30 second
Hai .. delay 1 second
Hai .. delay 1 second
Hai .. delay 1 second
Hai .. delay 1 second
Hai .. delay 1 second
Is that possible?
setInterval()i >= 5 ? 30000 + 1000*i : 1000*i