Search
 
SCRIPT & CODE EXAMPLE
 

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!')});
Comment

PREVIOUS NEXT
Code Example
Javascript :: While resolving: gatsby-starter-ghost@2.0.0 npm ERR! Found: react@17.0.2 
Javascript :: convert curl response to json format and echo the data 
Javascript :: javascript button click event 
Javascript :: how to console in node js 
Javascript :: node require fs not found 
Javascript :: push values to state array class react 
Javascript :: javascript onclick event 
Javascript :: Comparing and Filtering two arrays 
Javascript :: js operators 
Javascript :: post request with authorization 
Javascript :: uppercase-the-first-letter-of-a-string-using-javascript/ 
Javascript :: get selected text input javascript 
Javascript :: build#configuring-commonjs-dependencie - angular.json 
Javascript :: password regex 
Javascript :: how to set default value in input field in angularjs 
Javascript :: how to check if input is checked javascript 
Javascript :: destructuring objects 
Javascript :: how to increment variable value in javascript 
Javascript :: reactjs cdn file 
Javascript :: discord.js remove embed from message 
Javascript :: find the last occurrence of a character in a string javascript 
Javascript :: joi allow additional properties 
Javascript :: Find duplicate or repeat elements in js array 
Javascript :: resize image in node.js 
Javascript :: local reload go to top 
Javascript :: abrir dialog angular material 
Javascript :: react arrow function component 
Javascript :: image onclick react 
Javascript :: change li position in ul jquery 
Javascript :: black adam 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =