What is the difference between setTimeout and setInterval?
setTimeout runs once, while setInterval executes repeatedly at intervals
setTimeout executes repeatedly, while setInterval runs once
Both execute functions immediately
Both are used for canceling asynchronous tasks
This question is part of this quiz :
Asynchronous JavaScript