Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to run a function infinite time in javascript

function loopFunction(delay, callback){
    var loop = function(){
        callback();
        setTimeout(loop, delay);
    }; loop();
};

loopFunction(1000, function(){console.log('Hello World!')});
 
PREVIOUS NEXT
Tagged: #run #function #infinite #time #javascript
ADD COMMENT
Topic
Name
4+3 =