Published on 2020-05-06 • Modified on 2020-05-06
This function is the sibling of the
setTimeout function we saw in the previous snippet. This time it will allow us executing some code repeatedly with a given delay thanks to a snippet or a callback. Click on the start button to display a message in the console every second. Then, click on the stop button to stop the execution of the code. I have added a random number for each to see a different output for every call of the function.