xxxxxxxxxx
setTimeout(command, time);
//if you find the answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
xxxxxxxxxx
setTimeout(function(){
$('#overlay'). modal('hide')
}, 5000);
//#overlay will be the ID of modal which you want to hide or show modal
xxxxxxxxxx
setTimeout(function(){
console.log("hello");
}, 3000); //wait for atleast 3 seconds before console logging
xxxxxxxxxx
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);
xxxxxxxxxx
console.log('hello');
setTimeout(() => {
console.log('async message that appears on the screen in 1 second')
}, 1000);
console.log('world');
// hello
// world
// async message that appears on the screen in 1 second
xxxxxxxxxx
setTimeout(function(){
//code goes here
}, 2000); //Time before execution, 1000= 1 sec