I'm looking to loop through an array of booleans that will change based on what link the user clicks on. First, I initialize them...

```
var boolean1 = false;
var boolean2 = false;
var boolean3 = false;

```

Next, I have Strings that contain the links to a new page...

```
var link1 = "index.html";
var link2 = "someotherpage.html";
var link3 = "somepage.html";

```

Then, I put the values in respective arrays

```
var booleanArray = new Array(3);
booleanArray[0] = boolean1;
booleanArray[1] = boolean1;
booleanArray[2] = boolean1;

var linkArray = new Array(3);
linkArray[0] = link1;
linkArray[1] = link2;
linkArray[2] = link3;

```

Then, I have functions that change the values (The values will be called based one what link the user clicks on)...

```
//onlick...
function changeBoolean1()
{
    boolean1 = true;
}
function changeBoolean2()
{
    boolean2 = true
}
function changeBoolean3() 
{
    boolean3 = true;
}

```

Finally, based on which method was called `onlick`, one of the booleans will be set to `false`. At that point, I want to loop through the array of booleans, and get which one was set to `false`. Based on which one was `false`, it's respective link will open. 

```
function getChoice()
{
    for(var i = 0; i < booleanArray.length; i++)
    {
        if(booleanArray[i] == true)
        {
            window.location.href = linkArray[i];
            break;
        }
    }
}

```

However, the method does not get based the