setTimeoutsetInterval
setTimeout and setInterval are two fundamental JavaScript functions used for scheduling code execution. Both are part of the Web APIs and are commonly employed in web development to create dynamic and interactive user experiences.
setTimeout allows a function or a piece of code to be executed after a specified delay. It
setInterval, on the other hand, repeatedly executes a function or code snippet at a fixed time interval.
To stop the execution of functions scheduled by setTimeout or setInterval, the clearTimeout and clearInterval functions