Problem with Arrays

Hey guys,
I want to make a switch script, where when the player presses the switch the lights will turn on and off.But the complicated part is when you press the switch not just one , but more than one lights will turn off.
I tried to make a variable of type GameObject like : var lights : GameObject[];
and then on the Update function i wrote lights[].light.enabled = false (or true);
But that wouldn’t work of course.I thought of making a loop with an i for just 10 lights , for testing purposes so i did something like

for(i=0;i<11 lights*.light.enabled = false (or true) ;*
But it said Array out of Index…
How can I enable and disable all the GameObjects from my array?

If you don’t know the number of lights at all, but set them on the editor, best practice is to use:

for (var light : GameObject in lights) {
    // do anything with current light here
 }

You have 10 lights? Then you want i<10, as your lights are filling up lights[0] to lights[9].