title: setInterval only working inside of if(){} block
body: <p>So I think there is something key to be picked up from this situation I encountered and was hoping some experience could explain it.</p>
  
  <p>When I run this code, it does NOT work:</p>
  
  <pre><code>t5 = "nikolas"+t4;
  
  setInterval(adds,250);
  
  function adds(){
      if (t4 &lt; 100){
          t4=t4+1;
      }    
      else{
          return;
      }
  };
  </code></pre>
  
  <p>this does DOES work:</p>
  
  <pre><code>t5 = "nikolas"+t4;
  
  adds(t4);
  
  function adds(a){
  
      if (a &lt; 100){
          a=a+1;
          setInterval(t4=a,250);
      }
  
      else{
          return;
      }
  };
  </code></pre>
  
  <p>TL;DR: setInterval seems to work inside the if block but not outside. When it works it displays nikolast4 where t4 is an integer that 'ticks' from 1-100 (eg.<strong>strong text</strong> nikolas0 nikolas1 nikolas2 nikolas3 nikolas4)</p>
  
  <p>Also this code (due to the application I am programming in) is supposed to refresh every 250ms (but take the whole refreshing part with a grain of salt, not totally 100% sure about that).</p>