title: How to find out if setTimeout is running on the background
body: <p>I am having a problem to stop the setTimeout function fired previously.</p>
  <p>I found some relative questions and the giving solution is to put the time_out variable outside of the function to make it work. I tried but still not working.</p>
  <pre><code>   this.A = function(){
          if(time_out) clearTimeout(time_out);  
          // time_out is nothing here and this will return error
          
          time_out = setTimeout(function(){  }, 3000);
      }
      
      -------------------------------------------------
  
       this.time_out = 0;
       this.A = function(){
            if(this.time_out) clearTimeout(this.time_out);  
            //will run through, but the setTimeout setup previously will keep running...
              
           this.time_out = setTimeout(function(){  }, 3000);
       }
  </code></pre>
  <hr />
  <h3>Update</h3>
  <p>I tired put the whole function into a element and call it out when reset</p>
  <pre><code>if(el.data('time_out')) clearTimeout(el.data('time_out'));
  </code></pre>
  <p>This works perfect</p>