What you want is to access each element of that array and pass it to enableStructure(). This can be done in a for loop by making use of the length property of an array, which returns how many elements are in that array.