title: Clear all setIntervals
body: <p>I'm using <code>setIntervals</code> within an <code>each()</code> function like so</p>
  
  <pre><code>$(".elements").each(function() {
      setInterval(function() {
  
      }, 1000);
  });
  </code></pre>
  
  <p>Obviously a setIntervals is created for each element.</p>
  
  <p>My question is: How do I clear all the setIntervals when I no longer need them? I have tried storing the setInterval in a variable and call <code>window.clearInterval(int)</code>, but that only clears the last setInterval since each variable is overridden.</p>