数组和集合 / 字典

let d1 = [1"one"]
let d2 = [2"two"]
let d3 = [3"three"]

var dAll = d1.merging(d2) { (current, _) in current }
//dAll is [1: "one", 2: "two"]
print("dAll is \(dAll)")

d3.forEach { (key, value) in dAll[key] = value }
//dAll is [1: "one", 3: "three", 2: "two"]
print("dAll is \(dAll)")