Solving the Phantom Interval Problem In Javascript

If you’ve been working in javascript for any length of time you’ve run into the phantom interval problem. Essentially, you’ll have a button that sets an interval and double-clicking that button creates a phantom interval that you can’t clear or control. Here’s an article on how to solve the problem (spoiler: always clear the interval before you set it).