Merging dictionaries

Arrays and collections / Dictionaries

let m1 = new Map([
    [ 1, "one" ],
    [ 2, "two" ]])
let m2 = new Map([[3, "three"]])

let mAll = new Map(
    [...m1.entries(), ...m2.entries()]);
//mAll is { '1': 'one', '2': 'two', '3': 'three' }
console.log("mAll is", mAll)