remove

fun remove(key: K): V?

Removes the specified key and its associated value from the map. If the key was present in the map, this function returns the value that was present before removal.


fun remove(key: K, value: V): Boolean

Removes the specified key and its associated value from the map if the associated value equals value. Returns whether the removal happened.