0

I want my java script to sleep or wait for some seconds before it executes rest of the lines. But I don't want to put rest of my code inside function like in this --> setTimeout(function() {---code---},3000) since my function is very big.

I want something like thread.sleep in Java, in Javascript.

Could someone help me on this as I'm new to Javascript.

  • 2
    Does this answer your question? [What is the JavaScript version of sleep()?](https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep) – Cray Oct 12 '20 at 05:36

0 Answers0