Kotlin HashMap plusAssign()
Syntax & Examples


Syntax of HashMap.plusAssign()

There are 5 variations for the syntax of HashMap.plusAssign() extension function. They are:

1.
operator fun <K, V> MutableMap<in K, in V>.plusAssign( pair: Pair<K, V>)

This extension function appends or replaces the given pair in this mutable map.

2.
operator fun <K, V> MutableMap<in K, in V>.plusAssign( pairs: Iterable<Pair<K, V>>)

This extension function appends or replaces all pairs from the given collection of pairs in this mutable map.

3.
operator fun <K, V> MutableMap<in K, in V>.plusAssign( pairs: Array<out Pair<K, V>>)

This extension function appends or replaces all pairs from the given array of pairs in this mutable map.

4.
operator fun <K, V> MutableMap<in K, in V>.plusAssign( pairs: Sequence<Pair<K, V>>)

This extension function appends or replaces all pairs from the given sequence of pairs in this mutable map.

5.
operator fun <K, V> MutableMap<in K, in V>.plusAssign( map: Map<K, V>)

This extension function appends or replaces all entries from the given map in this mutable map.