isEmpty
Returns true
if the map is empty (contains no elements), false
otherwise.
Since Kotlin
1.0Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
println("emptyMap<Int, Int>().isEmpty() is ${emptyMap<Int, Int>().isEmpty()}") // true
println("mapOf(1 to 2).isEmpty() is ${mapOf(1 to 2).isEmpty()}") // false
//sampleEnd
}