settimeout es6
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);
Also in JavaScript:
- how to print the value of variable in javascript in html
- how to change the staticness of a object in matter.js
- how to find the gradient linear of image
- Setting axios base url dynamically
- ip my adress
- document.querySelector
- js string
- how to do a double bar chart with react-chartjs
- hackerrank fizzbuzz javascript
- find match in array object js
- multiple line string in jquery
- vuejs how use this.$slots.default
- node js fetch
- gatsbyjs image sharp
- href before onclick js
- dom create element
- chart js radar grid color
- how to make a div sticky using js
- how to convert date to string in javascript
- for in loops javascript
- javascript check if string contains a text substring
- javascript 1 line if
- gatsbyjs shop flotiq
- nvm show available versions