javascript how to hold time in a variable code example
Example 1: delay in javascript
setTimeout(function() {
//your code here
}, 1000);
Example 2: how to wait in javascript
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}