You are currently viewing Why do we have emptyCollection() but no emptyMutableCollection()?

Why do we have emptyCollection() but no emptyMutableCollection()?

Kotlin provides emptyList() but not emptyMutableList() . Is there a reason behind this?

val myList: MutableList<String> = mutableListOf()

vs.

val myList: List<String> = emptyList()

submitted by /u/Peng-Win
[link] [comments]