Thanks for the replies. I mainly just wanted to make sure that shifting an array wouldn't cause all the overhead that non-associative arrays have to deal with. Same for other methods that could be time-consuming unless handled properly.
Edit:
Whoops! Nevermind. Shifting and unshifting do come at a performance cost. Still fast if the array length is less than 1000.
As for hashes, I've seen stuff like an array/ordinary object that keeps track of the keys along with indices so it can be iterated w/o a for-in loop. It's always fun to see how people do things in different ways though for learning experiences.
Bookmarks