var myArray = ["Bob", "Nancy", "Jessie", "Frank"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
//Do something with element myArray[i]
}
I guess you need something like this.
Edit: Your array has only 4 elements. In the 2nd line I save the length of your array (4 elements –> length is 4) in the variable ‘arrayLength’. Then I wrote a simple for-loop which cycles the ‘i’ from 0 till 3 so you can access your elements from your array as ‘myArray[i]’.