The index is extremely useful in many cases, such as when it
represents the order in which the items are displayed and that needs
to be manipulated.
Also, in my case I have some legacy javascript functions that perform
a certain operation on a particular item and take the index passed in
as a parameter. I don't want to rewriting a lot of code and
unnecessarily risk introducing bugs, nor do I want to do lookups to
find the index each call, which is slow and inefficient.
Why would anyone want to limit there options and not have access to
the index of an array? I never understood like keep acting as though
it's not needed... not having access to the index breaks the way
arrays are intended to work (directly selecting an element without
having to search for it). Why would you rather than have a bunch of
variables with pointers to those items separately? Or have to search
through it the entire list every time you want to find a single item?
If I want the next or a previous item in my array because I am doing a
calculation, and I don't have the index, I need to create a next and
previous variable that points to those values and search through them
all to populate these first. Perhaps I am missing something, but to
me,
array[index+1] and array[index-1] just seems straightforward and clear
to me.