isEmpty

expect open override fun isEmpty(): Boolean(source)

Returns true if the map is empty (contains no elements), false otherwise.

Since Kotlin

1.0

Samples

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
}