let arr = [['a', 1], ['b', 2]];
let map = new Map(arr);
IE11 returns empty object.
Documentation says that passing iterable to constructors in IE11 is supported only as arrays of key/value pairs, but its not working. Anyone have this issue?
MDN is specific to Firefox, being from the Mozilla Development Network. Most browsers behave the same or similar, as Firefox tries to stay as close as it reasonably can to the specs, but sometimes there are differences/improvements, such as with this.
I have to retract my “it works for me” statement. I happened to be on the google homepage when I ran that in the console, but I discovered the same code doesn’t work in the console on other pages. It looks like it only worked for me before because google polyfilled/monkey patched the implementation of Map on their site.
I’m more disappointed to say that perhaps MDN did indeed have wrong information in this case. They claimed IE11’s Map could be initialized with an array of key/value pairs, but that doesn’t seem to be the case.