Javascript creating a delayed for loop

Javascript creating a delayed for loop
0.0 0

#1

Hello, I am having trouble creating a delayed for loop. does anyone know a successful way to do this?
This is what I am trying right now. I want the function to execute, and then wait before executing again. Thanks!
ps:
The function lights up certain cells, and they are currently just lighting up all at the same time.

function lightUp()
{
  for (i=0;i<gameIndex.length;i++)
  {
  tester=setTimeout(switcheroo(gameIndex[i]),1000);
}
}

#2
for (let i = 0; i < gameIndex.length; i++) {
    tester = setTimeout(switcheroo, i*1000, gameIndex[i]);
}

EDIT: The above does allow a tiny (5-10 ms delay before the first time the function is executed due to the nature of setTimeout), but the following would not have any delay before the first execution of switcheroo.

switcheroo(gameIndex[0]);
for (var i = 1; i < gameIndex.length; i++) {
    tester = setTimeout(switcheroo, i*1000, gameIndex[i]);
}

#3

Thank you very much!