I am trying to create a "sleep" function where I like to wait 10 seconds before continue with next command.
This doesn't work. No sleep is occuring. How can I put it nicely in a function like I do below "sleep(10000)" which is possible to call?
console.log("Hello");
sleep(10000);
console.log("World!");
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}