Basic Scripting Question: How to access one element of an array by index, and print it?

Here is an snippet of how you would loop through an array outputting both the element and index of the array to the log:

for (Index := 0..MyArray1.Length-1):
    if (Element := MyArray1[Index]):
        Log("{Element} in MyArray1 at index {Index}")