I am working on a website, where I need to create a pause or delay. So please tell me How to create pause or delay in for loop in javascript or
for
javascript
if you want to create pause or delay in FOR loop,the only real method is
while (true) { if( new Date()-startTime >= 2000) { break; } }
the startTime is the time before you run the while but this method will cause the browsers become very slow