title: JavaScript: How to get setInterval() to start now?
body: <p>I am using the <code>setInterval()</code> function to call a function every 20 seconds. However, one thing I noticed is that it the first time <code>setInterval()</code> actually calls the function is at 20 seconds (and not when <code>setInterval()</code> is called). Here is my current workaround:</p>
  
  <pre><code>dothis();
  var i = setInterval(dothis, 20000);
  </code></pre>
  
  <p>Is there any way to achieve this without having this duplicate code?</p>