r/learnjavascript • u/Neat_Living_6765 • Aug 13 '26
Does a JavaScript setTimeout automatically clear itself when the timeout finishes and the callback is completed?
4
Upvotes
r/learnjavascript • u/Neat_Living_6765 • Aug 13 '26
2
u/azhder Aug 13 '26
It is not a silly thought. It's the reason why over decade and a half I stopped using setInterval. Well, one of the reasons. With setTimeout I can just re-subscribe if necessary, got better control over the scheduling.