Is there a way I can do a sleep in JavaScript before it carries out another action?
Example:
var a = 1+3; // Sleep 3 seconds before the next action
You can use plain javascript, this will call your function/method after 5 seconds:
setTimeout(()=> { your_function(); }, 5000);