In JavaScript, setTimeout() and setInterval() methods are used to add delay before executing some action.
The setTimeout() method only executes the statement once but the setInterval() method executes repeatedly until the interval is not been cleared.
In this tutorial, I show how you can use the setTimeout() method to set some delay before redirecting to another page.