If you want to check if an array has a certain index or not;
var array = 
var index: int
index can be any number of your choosing and the statement will return a bool based on whether the array has the index or not.
You can also replace 'index' with the iterator variable if the above statement is inside a for loop. It would need to be done this way:
for i in range(array.size()):