adsense

Sunday, July 3, 2022

setInterval() and setTimeout()

If we want to execute a specific JS function after some time there are two options to use fro,.  


  • setTimeout used  run a function once after the interval specified 
  • setInterval used   run a function repeatedly, after the interval specified and repeating continuously at that interval.

If we want to stop the indefinite function call  we can use clearInterval with setInterval.


Cheers,

Samitha


No comments:

Post a Comment