Is there a sleep function in JavaScript? - Stack Overflow
If you are looking to block the execution of code with call to sleep, then no, there is no method for that in JavaScript. JavaScript does have setTimeout method. setTimeout will let you defer execution of a function f...