+ 2
Index
How does adding an index help?
2 Respuestas
0
Index is used to find an item within an array. Be an array of objects or even to go through a String, which is an array of chars.
0
The point of an index is to remember where you are in a list, at a certain iteration, or in a string. Imagine you are using a function to find an item in a list for you. If you now wanted to go back and split the list in half where that item is, how would you know where to split it? Use the index in order to find the exact location.