typescript map constructor code example
Example 1: js map constructor
let myMap = new Map([
[1, 'one'], // [key, value]
[2, 'two'],
[3, 'three'],
]) // from MDN
Example 2: initialize a map js
let map = new Map()
map['bla'] = 'blaa'
map['bla2'] = 'blaaa2'
console.log(map) // Map { bla: 'blaa', bla2: 'blaaa2' }