title: Simple function not passing through the variable correctly
body: <p>I'm trying to make this function:</p>
  
  <pre><code>autoFn();
  
  function autoFn(){
    setTimeout(function(){ console.log('another second') }, 1000);
    setTimeout(autoFn, 1000);
  }
  </code></pre>
  
  <p>Pass in a variable rather than writing 1000 twice, as follows:</p>
  
  <pre><code>autoFn(1000);
  
  function autoFn(n){
    setTimeout(function(){ console.log('another second') }, n);
    setTimeout(autoFn, n);
  }
  </code></pre>
  
  <p>But the above is not working correctly. After 1000ms, it just runs about a million times. Can someone explain what I'm doing wrong here, and how to fix it? It should, after 1000ms (1 second), just run again but wait another second until it logs 'another second' to the console.</p>
  
  <p>Any advice here would be much appreciated. Thanks for any help here.</p>