title: Call an anonymous function defined in a setInterval
body: <p>I've made this code:</p>
  
  <pre><code>window.setInterval(function(){ var a = doStuff(); var b = a + 5; }, 60000)
  </code></pre>
  
  <p>The actual contents of the anonymous function is of course just for this small example as it doesn't matter. What really happens is a bunch of variables get created in the scope of the function itself, because I don't need/want to pollute the global space.</p>
  
  <p>But as you all know, the doStuff() function won't be called until 60 seconds in the page. I would also like to call the function right now, as soon as the page is loaded, and from then on every 60 seconds too.</p>
  
  <p>Is it somehow possible to call the function without copy/pasting the inside code to right after the setInterval() line? As I said, I don't want to pollute the global space with useless variables that aren't needed outside the function.</p>