Sorting a Hashtable or Dictionary in Javascript?

I am keeping a list of an NPC’s “needs” in a Dictionary

public var needs : Dictionary.<String,int> = new Dictionary.<String,int>();

The key is the name of the need, and the value is numeric. How can I sort the dictionary by value? I’ve found a few examples in C# that use Linq, but I haven’t been able to translate it to Javascript.

Any help would be appreciated

Update:
I think I’ve solved my problem for now:

needs.OrderBy(function(need){ need.Value; }).

Thanks to http://unitygems.com/linq-1-time-linq/

Maybe you could use SortedDictionary instead, or you could show the C# examples.

–Eric

You won;t often need to sort a dictionary, as you wouldn’t usually be indexing them by number.
You can iterate the whole dictionary with a foreach, or retrieve by key; but probably wont want to get the ‘first’ entry at dict[0], etc