set interval run inner function immediately code example
Example: javascript setinterval run immediately
foo()
setInterval(foo, delay)
// OR
function foo() {
// ...
setTimeout(foo, delay)
}
foo()
foo()
setInterval(foo, delay)
// OR
function foo() {
// ...
setTimeout(foo, delay)
}
foo()