Keep the current value (value in dictionary1) if there is a duplicate key
dictionary1.merge(dictionary2) {(current,_) in current} |
Keep the new value (value in dictionary2) if there is a duplicate key
dictionary1.merge(dictionary2) {(_,new) in new} |
https://www.tutorialkart.com/swift-tutorial/merge-dictionaries-in-swift/