The Map() constructor creates Map objects.
Map()
new Map([iterable])
Arrays with two elements, such as [[ 1, 'one' ],[ 2, 'two' ]].)
let myMap = new Map([ [1, 'one'],/* w w w.j ava 2s .co m*/ [2, 'two'], [3, 'three'], ]); console.log(myMap);