JavaScript SetTimeout
setTimeout(function(){
alert("Sup!");
}, 2000);//wait 2 seconds
Grepper
setTimeout(function(){
alert("Sup!");
}, 2000);//wait 2 seconds
// set
var timerid = setTimeout(() => {
console.log('hi :D ');
}, 1000);
// clear
clearTimeout(timerid);
// Syntax
// set
myVar = setTimeout("javascript function", milliseconds);
// clear
clearTimeout(id_of_settimeout);
/ Rnadco.ir /
doWork(callback) {
setTimeout(() => callback(this.name), 15);
}
if (timerid) {
clearTimeout(timerid);
}
timerid = setTimeout(() => {
this.reqMaq(obj['fkmaqid'])
}, 2000);