setInterval(()=>{
for (j = 0; j < obj.length; j++) {
}
})
I have this loop setup, is there any way to make the for loop go slower? obj length can be as big as 200-400 arrays. Jquery answers accepted.
setInterval(()=>{
for (j = 0; j < obj.length; j++) {
}
})
I have this loop setup, is there any way to make the for loop go slower? obj length can be as big as 200-400 arrays. Jquery answers accepted.
Promise based delay:
const delay = x => new Promise(res => setTimeout(res, x));
(async () => {
for (let j = 0; j < 10; j++) {
console.log(j);
await delay(1000);
}
})();
(Furthermore, i believe that jQuery should never be used.)