start interval js code example
Example 1: js setinterval
function func(){
console.log("Ran")
}
setInterval(func,1000)//Runs the "func" function every second
Example 2: javascript setinterval run immediately
foo()
setInterval(foo, delay)
// OR
function foo() {
// ...
setTimeout(foo, delay)
}
foo()