Javascript data structure for fast lookup and ordered looping?

Viewed 11745

is there a data structure or a pattern in Javascript that can be used for both fast lookup (by key, as with associative arrays) and for ordered looping?

Right, now I am using object literals to store my data but I just disovered that Chrome does not maintain the order when looping over the property names.

Is there a common way to solve this in Javascript?

Thanks for any hints.

3 Answers
Related