merge

fun <K, V1 : W, V2 : W, W> merge(map1: Map<out K, V1>, map2: Map<out K, V2>): Map<K, W>

Merges the first map and the second map prioritising the second one.

Precisely, corresponding keys and values of the received maps are put into a new empty map which is returned after afterwards. For every key appearing in both maps corresponding value from the second map is chosen.

Return

the result of the merge.

Parameters

map1

the first (less prioritised) map to merge.

map2

the second (more prioritised) map to merge.