1var delayInMilliseconds = 1000; //1 second
2
3setTimeout(function() {
4 //your code to be executed after 1 second
5}, delayInMilliseconds);
6
1setInterval(function(){
2 console.log("Oooo Yeaaa!");
3}, 2000);//run this thang every 2 seconds
1// wait 1000ms and then run func()
2let myTimeout = setTimeout(func, 1000);
3// cancel the timeout
4clearTimeout(myTimeout);