Weird arithmetical behavior in JavaScript

listed in answer

Weird arithmetical behavior in JavaScript
0 votes, 0.00 avg. rating (0% score)

ANSWER:

Use the following code:

var self = this; // preserve this to be used inside the callback
setInterval(function()  self.update(); , 3000)

Usually what you did would work, but some (Gecko-based) browsers pass an argument to the timer callback function.

by ThiefMaster from http://stackoverflow.com/questions/10791035