Lighting script

I use a script to flicker lights to produce a lighting effect from a thunderstorm. However all my lights flash at different intervals. I tried making it an array of objects and to make them all flash at the same time using this code

var lights: GameObject[];
var flickerSpeed : float = 0.07;
private var randomizer : int = 0;
while (true) {
    if (randomizer == 0) {
        lights.GetComponent.<Light>().enabled = false;
    }
    else lights.GetComponent.<Light>().enabled = true;
    randomizer = Random.Range (0, 1.1);
    yield WaitForSeconds (flickerSpeed);
}

However I get the error

Assets/_Scripts/Flickerv2.js(6,16): BCE0019: 'GetComponent' is not a member of 'UnityEngine.GameObject[]'. 

Any help on a way to approach this is appreciated.

Oh yeah… (the guy below is right (and the guy below him seems even righter))

lights is an array. You need to specify what gameObject in the array you are trying to access :

lights[ index ].GetComponent.<Light>().enabled = false;