In javascript, is there a data structure that tracks insertion/update order? for instance, if you have:
map[a]=1
map[b]=2
map[c]=3
I would want to get the keys in order a,b,c but if I had
map[a]=1
map[b]=2
map[c]=3
map[b]=4
I would want the keys in order a,c,b since b was last updated.
I'm currently doing this with a js object and a sorted list to track update order. Is there a better way to do this?