setTimeout runs only once?

setTimeout should only run once. You’re looking for setInterval. var loop_handle = setInterval(slide, 3000); Also, the second argument should be a number, not a string. When the function call doesn’t require any arguments, it’s better to reference to the function instead of using a string. A string would be converted to a function. This function … Read more

Does Node.js enforce a minimum delay for setTimeout?

It doesn’t have a minimum delay and this is actually a compatibility issue between browsers and node. Timers are completely unspecified in JavaScript (it’s a DOM specification which has no use in Node and isn’t even followed by browsers anyway) and node implements them simply due to how fundamental they’ve been in JavaScript’s history and … Read more

What the difference between window.setTimeout() and setTimeout()?

JavaScript runs in an environment that is defined by a global object. Methods of the global object can be called without explicitly refering to the object (i.e. without the obj.function() notation). When you run JavaScript inside the browser, the global object is provided by the Document Object Model (DOM). The global object of the DOM … Read more