Answers for "adding delay in javascript foreach loop"

0

adding delay in javascript foreach loop

// tasks is your array
tasks.forEach((element,i) => {
                setTimeout(
                    function(){
                     	//the work you want to perform   
                    }
                , i * 300);
});
Posted by: Guest on April-26-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language