How would you do this? Instinctively, I want to do:
var myMap = new Map([[\"thing1\", 1], [\"thing2\", 2], [\"thing3\", 3]]); // wishful, ignorant thinking
You should just use Spread operator:
var myMap = new Map([["thing1", 1], ["thing2", 2], ["thing3", 3]]); var newArr = [...myMap].map(value => value[1] + 1); console.log(newArr); //[2, 3, 4] var newArr2 = [for(value of myMap) value = value[1] + 1]; console.log(newArr2); //[2, 3, 4]