Just started using Kotlin in our projects. To initialise an immutable map or list (possibly any collections in Kotlin) I could see two options mapOf() and emptyMap() (listOf() and emptyList() for a list).
Basically, the mapOf is nothing but an inline function that returns emptyMap().
@kotlin.internal.InlineOnly
public inline fun <K, V> mapOf(): Map<K, V> = emptyMap()
What is preferred over another and why does Kotlin expose both?