Map object support in Google Apps Script

Viewed 3487

Does Google Apps Script supports the Map object?

When I try to use it I get:

ReferenceError: "Map" is not defined. (line 21, file "Code")
2 Answers

Now is possible by changing your script to use the new runtime that runs on V8. Enable it in the menu "Run/Enable new Apps Script runtime powered by Chrome V8"

function testMap(){
  var m = new Map();
  m.set("a", "value")
  Logger.log(m.get("a"));
}

Output:

[20-02-16 12:25:42:404 CST] value
Related