I have an associative array named map:
var map = new Array();
map["exampleKey"] = 7;
The keys are strings and the values are integers. Some keys may have the same value.
I have tried solutions from similar questions like this one. However, I have not found one yet that preserves the values. They simply creates arrays with the keys in order. I need a sort that stores the keys and values in order (sorted by value) into some appropriate data structure.
I also do not have a server so any solution must be JavaScript.