Or even better just use “LastIndex” instead of length - 1, otherwise it won’t work if the array length is equal to 1.