W3cubDocs

/Kotlin

getOrDefault

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

Platform and version requirements: Kotlin 1.2, JVM, JRE8

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

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/get-or-default.html