However, it’s not the only thing that array keys does. There’s also the ability to make arrays that are not indexed and thus allow you to store multiple items in them.
If you want to store data in your array, your computer could do so. But if you want to store data that is not in your array, your computer has to do the same.
This is a great and effective way of making array items that exist in your array be indexed. This is the same thing you do when you create a multidimensional array with nested objects, or a hash table, or a set. But instead, it is done with an array that does not have an index, and thus can store any number of different objects that are not in your array at all.
This is a huge time saver once you get used to it. Sometimes you need the array keys in order to reference a particular element, but sometimes you need it in a different place.
This is especially useful when you’re trying to create a new array that has all different items of a certain type.
You can create an array that has all different items of a certain type by using a key in your array.