const foo = () => console.log("First"); const bar = () => setTimeout(() => console.log("Second"), 500); const baz = () => console.log("Third"); bar(); foo(); baz();setTimeout(function(){ alert("Sup!"); }, 2000);//wait 2 seconds setTimeout(function(){ alert("Hello"); }, 3000); setTimeout(function(){ $('#overlay'). modal('hide') }, 5000); //#overlay will be the ID of modal which you want to hide or show modal// Run anonymous function after 5,000 milliseconds (5 seconds) setTimeout(() => { // Run code }, 5000);setTimeout(() => console.log('running') , 1000) // or setTimeout(() => { console.log('running') }, 1000);setTimeout(function(){ console.log("hello"); }, 3000); //wait for atleast 3 seconds before console loggingsetTimeout(() => { console.log('hi') }, 1000)setTimeout(function(){ //code goes here }, 2000); //Time before execution, 1000= 1 sec or you can use the arrow function too setTimeout(() => { // Code to be executed after the delay console.log('Timeout completed!'); }, 1000);setTimeout(function(){ console.log("Executed after 1 second"); }, 1000);setTimeout(function(){ //code goes here }, 2000); //Time before execution, 1000= 1 sec