I use javascript for a loop to iterate over a specific array and warn its value. After each warning, I want it to stop for 30 seconds and then continue ... until the end of the cycle. my code goes here.
for(var i=0; i<valArray.lenght; i++)
{
alert("The value ="+valArray[i]);
}
I used the setTimeout () function, but it doesn’t work ... like loop termination, but doesn’t stop at the 30 second interval ... is there any other way, for example, the sleep function in PHP?
source
share