Don't use *new Array()*, try this instead:
// Declare an empty array using array literal notation
var selectedUnits = [];
To access any element in the array, say the sixth element, do:
selectedUnits[6];
So for example if you wanted to save the sixth element of the array & print the value:
unitSix = selectedUnits[6];
Debug.log(unitSix);
Take a look at [this tutorial](http://freewebdesigntutorials.com/javaScriptTutorials/jsArrayObject/declareAnArray.htm) for more info on arrays.
↧