Here is the C# but I am not sure how is should look in JS.
var list = countIndex.ToList<KeyValuePair<TKey, TValue>>();
Also, is it possible to either swap TKey, TValue in this or in a dictionary in general?
Here is the C# but I am not sure how is should look in JS.
var list = countIndex.ToList<KeyValuePair<TKey, TValue>>();
Also, is it possible to either swap TKey, TValue in this or in a dictionary in general?
So turn the values into keys that point to their original keys? It’s possible but you might not get a one-to-one swap because keys need to be unique but values don’t.
Ok you have two questions… not sure about the JS question but as long as your Values are unique (you’ll get an exception if they aren’t), you can do the following:
var swappedDictionary = countIndex.ToDictionary(kvp => kvp.Value, kvp => kvp,Key);
Are lambda expressions supported in JS?
Also - to OP’s other question, put a space between >> so it becomes > >. The JS parser sees it as a bit shift operator.
No idea.