setInterval() - but run it only once
<p>If I call the update function several times I get multiple instances of this interval running. How can I be sure that this only gets triggered once per idVar?</p>

<p>For example if I run this twice in a row with the same idVar I get two updates per second, where it should only be one.</p>

<p>If the idVar is different it should run multiple times. idVar is used in Update().</p>

<pre><code>intervals[idVar] = setInterval(function() {
    update();                            
}, 1000);
</code></pre>