Granted the following piece of code:
function updateOdometers(odometers) {
setTimeout(function(){
odometers[1].update(odometers[1].value + 10);
}, 500);
}
setInterval(updateOdometers(odometers), 2000);
For whatever reason, this code updates the value of odometer only once, rather than every 2000ms with a delay inside. Googling/SO-ing around didn't get me much of a result. Any ideas?