How to apply a programme to all values in a list simultaneously I'm attempting to turn on a set of LED's one at a time and then switch them all off at the same time, I am stuck however on turning them off at the same time. 

That is my code:

int ledpins[] = {2,3,4,5,6,7,8,9}; //creates a list of the pins in use

void setup() {
  for (int i = 0; i &lt; 8; i++){
    pinMode(ledpins[i], OUTPUT);  // iterates over the list led pins from the 0 pin to the pins before the eigth
  }  
}

void loop() {
  for (int i = 0; i &lt; 8; i++){
    digitalWrite(ledpins[i], HIGH); // turns all the pins of one at a time
  }

  delay(100); //when all on will wait 100 ms
  digitalWrite(ledpins[0,7], LOW); //turns off all the leds at once
  delay(100);
}


The annotations are for my own understanding.
I just need help turning all the LED's off at once which I dont know the command for.
You have already done it twice, why are you struggling the third time?

for (int i = 0; i &lt; 8; i++){
  digitalWrite(ledpins[i], HIGH); // turns all the pins of one at a time
}



  // turns all the pins of one at a time


Except that it is happening so fast you can't see then doing it individually. So just do the same but set them to LOW:

for (int i = 0; i &lt; 8; i++){
  digitalWrite(ledpins[i], LOW); // turns all the pins off one at a time
}


Now you might want to add a delay into the loop that turns them on so you can see them turn on individually instead of all at once:

for (int i = 0; i &lt; 8; i++){
  digitalWrite(ledpins[i], HIGH); // turns all the pins of one at a time
  delay(50);
}