title: setTimeout or setInterval?
body: <p>As far as I can tell, these two pieces of javascript behave the same way:</p>
  <p><strong>Option A:</strong></p>
  <pre><code>function myTimeoutFunction()
  {
      doStuff();
      setTimeout(myTimeoutFunction, 1000);
  }
  
  myTimeoutFunction();
  </code></pre>
  <p><strong>Option B:</strong></p>
  <pre><code>function myTimeoutFunction()
  {
      doStuff();
  }
  
  myTimeoutFunction();
  setInterval(myTimeoutFunction, 1000);
  </code></pre>
  <p>Is there any difference between using <a href="https://developer.mozilla.org/en-US/docs/Web/API/setTimeout" rel="noreferrer">setTimeout</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/setInterval" rel="noreferrer">setInterval</a>?</p>