js how to set timeout code example
Example 1: javascript settimeout
window.setTimeout(()=>{
console.log('1 second passed!');
}, 1000);
Example 2: javascript settimeout
// Redirect to index page after 5 sec
setTimeout(function(){ window.location="index"; },5000);