Home » Javascript » Map functions (e.g. #values) available in one tab's console, not another (IE 11)

Map functions (e.g. #values) available in one tab's console, not another (IE 11)

Posted by: admin November 1, 2017 Leave a comment

Questions:

I have noticed that Map functions, such as Map#values() and new Map(iterable) are available in the console of one IE tab, and not another. Why is this the case?

Tab 1:

> var a = new Map();
undefined
> a.set("A", "Apple");
undefined
> a.set("B", "Blue Bottle");
undefined
> a.set("C", "Cattle");
undefined
> a.values();
Object doesn't support property or method 'values'

Tab 2:

> var a = new Map();
undefined
> a.set("A", "Apple");
{...}
> a.set("B", "Blue Bottle");
{...}
> a.set("C", "Cattle");
{...}
> a.values();
{...}
console.log(a.values());
undefined
[object Map Iterator]
   {
      [functions]: ,
      __proto__: { },
      _k: "values",
      _l: undefined,
      _t: { }
   }
Answers: