kotlin.collections.getOrDefault

getOrDefault

inline fun <K, V> Map<out K, V>.getOrDefault(
    key: K, 
    defaultValue: V
): V

Platform and version requirements: Kotlin 1.1, JVM, JRE8

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.