JavaScript has no sleep function, but we can easily solve it this way!
In order to make your browser sleep, just write this line of code:    await new Promise(_ =&gt;...
Tags: javascript, promise, sleep, tips