clearInterval and clearTimeout are interchangeable

The IDs returned by window.setInterval and window.setTimeout use a shared pool. And it doesn't matter whether you use window.clearTimeout or window.clearInterval to cancel an interval or timeout.

Live example on CodePen:


This article has been published on on my blog. Here's a list of all articles if you're interested in this kind of stuff.