plusAssign

Appends or replaces the given pair in this mutable map.

inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(pair: Pair<K, V>)(source)
val scores = mutableMapOf<String, Int>()

// Add entries using plusAssign (+=)
scores += "Alice" to 85
scores += "Bob" to 92

// Update an existing entry
scores += "Alice" to 90

println(scores)  // Output: {Alice=90, Bob=92}

Source