title: Check if a timeout is waiting to run?
body: <p>I have an infinity scroll style page I'm working on, (for an example of infinity scroll, click <a href="http://mylittlefacewhen.com" rel="noreferrer">here</a> and scroll down) which runs a function called <code>update()</code> every time the user scrolls, among other things.</p>
  
  <p>I could use <code>setInterval</code> instead and check every x millis, however with a timeout that calls itself, the page responds quicker and more reliably.</p>
  
  <p>Basically, <code>update()</code> adds some content to the page, then, if that content isn't enough to let you scroll down more, sets a timeout to call <code>update()</code> again.  If you only scrolled one pixel, this would be fine, but of course, when you scroll it sends tens or hundreds of scroll events.  This becomes a problem because there will be tens (or hundreds) of timeouts running at once.  Having too many timeouts kills the consistent animation of adding new content I was going for.</p>
  
  <p>So I wanted to check for if a timeout was already waiting to execute using the ID I had, however there doesn't seem to be a function for this is JavaScript.  Is there a way to check whether a timeout ID has executed yet or not?  If not, are there alternatives?  I have JQuery.</p>
  
  <p>...Or should I just make an interval and sacrifice the responsiveness?</p>