I have a JavaScript object with a privileged method. When this method has completed, I would like it to call itself (after a small timeout) and continue running indefinitely
Try
function Test() { // ... private variables that testMethod needs to access ... this.testMethod = function() { alert("Hello, from the method."); var self = this; setTimeout(function() { self.testMethod(); }, 2000); }; }
or use setInterval.