merge method

Map<K, V> merge(
  1. Map<K, V> other
)

Merges this map with another map.

If a key exists in both maps, the value from other is used.

Example:

{'a': 1, 'b': 2}.merge({'b': 3, 'c': 4});
// {'a': 1, 'b': 3, 'c': 4}

Implementation

Map<K, V> merge(Map<K, V> other) {
  return {...this, ...other};
}