Answers for "how to stop a function after some time in javascript"

19

js settimeout

setTimeout(() => { alert('Hello') }, 1000)
Posted by: Guest on February-03-2020
15

js setinterval

function func(){
  console.log("Ran")
}
setInterval(func,1000)//Runs the "func" function every second
Posted by: Guest on March-07-2020
4

javascript setinterval

setInterval(function() {
  //Your code
}, 1000); //Every 1000ms = 1sec
Posted by: Guest on May-22-2020

Code answers related to "how to stop a function after some time in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language