Q:

How to make a for loop slower?

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.

A:

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.)

