Replace length with last index. length will give you a length of 1 if you have an item at index 0. Last index will give you index zero if you have an item at index 0.
Replace length with last index. length will give you a length of 1 if you have an item at index 0. Last index will give you index zero if you have an item at index 0.