1setTimeout(function(){
2 console.log("hello");
3}, 3000); //wait for atleast 3 seconds before console logging
1console.log('hello');
2setTimeout(() => {
3 console.log('async message that appears on the screen in 1 second')
4}, 1000);
5console.log('world');
6
7// hello
8// world
9// async message that appears on the screen in 1 second
1// Redirect to index page after 5 sec
2setTimeout(function(){ window.location="index"; },5000);