title: Clear all running intervals
body: <p>I am trying to clear all intervals at the same time with the same ID.</p>
  
  <p>Reason for this is so multiple agents can have calls originated to them, so it works accordingly but when more than one agent/interval is involved the interval is not cleared and to the best of my understanding clearInterval only ever clears the last interval.</p>
  
  <p>Is it possible to clear all Intervals all the same time with the same ID? or just clear all intervals?</p>
  
  <p>I looked at the other questions regarding the same topic but didn't work for me and wondered if there was an up to date method of handling this.</p>
  
  <p><strong>Basic Code Idea:</strong></p>
  
  <pre><code>var extenArray = [];
  
  //Passport.js
  app.get('/index', checkLoggedIn, function (req, res) {
      res.render('index', {
        isAuthenticated : req.isAuthenticated(),
        user : req.user
      });
      if(extenArray.length &gt; 0){ 
        intervalId = setInterval(bridgeCall, 10000);
        console.log("Running");
      }
    });
  
    function bridgeCall() {
      if (extenArray.length &gt; 0) {
         console.log("Begin!")
         console.log("value removed from array");
      } else {
        error = ("No extensions left to dial");
        Error();
        if(extenArray.length &lt; 1){
        clearInterval(intervalId);
        console.log("Cleared Interval")
        }
      }
    }
  </code></pre>
  
  <p>Every time a extension is called its removed from the array but I want to keep the code sample as possible, but can flesh it out if required.</p>
  
  <p>Is there a way to clear all the intervals with the same ID at the same time?</p>