Someone told me that when you use setTimeout you must clear it with clearTimeout. I can understand before the timeout runs out, but why after? Or is it untrue?
Someone told me that when you use setTimeout you must clear it with clearTimeout
Share
It’s not true – there’s no harm in clearing a timeout after it has finished, but it’s not necessary.
Per the specification:
In other words, it’s a no-op; nothing happens, and no error will be thrown.