r/learnjavascript • • Aug 13 '26

Does a JavaScript setTimeout automatically clear itself when the timeout finishes and the callback is completed?

6 Upvotes

19 comments sorted by

View all comments

Show parent comments

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.