hashtable versus javascript array

Does anyone know the performance hit if any of using a hashtable array and iterating over the keys versus a javascript array and looping through all the entries?

Is it a big difference or pretty much the same, and therefore the only faster way is to use a built-in .NET array?

A hashtable lookup is much faster in the general case than searching through an array until you find the correct item. On average, the iterative search will need to look through half the items before finding the correct one. A hashtable uses a neat trick that lets it jump over most of the array elements and start the search very close to the target.

Sorry yes I realise that, I was actually taking about the speed of simply looping through all the elements.

So I did a quick test and a array is slightly quick, which you might expect but not by too much.

Timings for 100,000 elements

.Net SortedList

5.33 seconds to initialise with values
0.0234 seconds to iterate through

Unity javascript array

3.88 seconds to initialise with values
0.0199 seconds to iterate through

Unity hashtable

0.59 seconds to initialise with values
0.0238 seconds to iterate through

Converting the Unity javascript array to a built-in array brings the iteration time down to 0.000312 seconds so that is quite some speed improvement!

I wish there was a equivalent for hashtables, that would be handy.