I am wondering if there is a way to make a setTimeout (or some equivalent) in JavaScript that would not move on to the next line until the time was up. For example is there a way to make the below code work as intended?
var cntr = 0;
while(cntr < 25) {
setTimeout(200); //wait 200ms to continue to next line
console.log(cntr); //or some other task
cntr++;
}
Thank you in advance for any answers I receive!