Javascript Map ordering
问题 i recently had a bug in my code that was due to me missing the " in insertion order " text while looking through Map object details on MDN. In short, i have a map object, lets say let myMap = new Map; and then, after populating it, i iterate over its contents with a simple for .. of statement. Like this for (let [key, val] of myMap) { ... } The code in for loop depends on (key, value) pair to be sorted by key . However the algorithm that populates the map, does so in a random order(and i can