js timeoput code example
Example 1: timeout javascript
setTimeout(function(){
//code goes here
}, 2000); //Time before execution
Example 2: javascript timeout
// wait 1000ms and then run func()
let myTimeout = setTimeout(func, 1000);
// cancel the timeout
clearTimeout(myTimeout);