Fill in elementOr so that it returns arr[i], or def when the index is outside the array.
elementOr
arr[i]
def
The program prints 2 and then -1.
2
-1