mutableMapOf

external fun <K, V> mutableMapOf(vararg pairs: Pair<K, V>): MutableMap<K, V>(source)

Creates a fresh mutable HashMap containing the supplied key-value pairs.

Later pairs with equal keys replace earlier values while retaining the first stored key. Arguments are evaluated once in source order before population performs hashing or equality. Iteration order is unspecified. Guest Kotlin supports direct vararg arguments; spread arguments remain unavailable.

Return

a new mutable map, empty when no pairs are supplied.

Parameters

pairs

associations to insert in argument order.

Type Parameters

K

key type.

V

value type.

See also