Skip to content

Instantly share code, notes, and snippets.

@apotox
Created July 29, 2021 09:13
Show Gist options
  • Save apotox/5bb2ffa02ffef62bbaefb473ade164e2 to your computer and use it in GitHub Desktop.
Save apotox/5bb2ffa02ffef62bbaefb473ade164e2 to your computer and use it in GitHub Desktop.
setinterval
const handler=()=>{
console.log("hello")
}
// call the handler function every 2sec
let stopper = setInterval(handler, 2000)
// stop the setInterval method
clearInterval(stopper)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment