mutableListOf

fun <T> mutableListOf(vararg elements: T): MutableList<T>(source)

Returns a new MutableList with the given elements.

Since Kotlin

1.0

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val list = mutableListOf(1, 2, 3)
println(list) // [1, 2, 3]

list += listOf(4, 5)
println(list) // [1, 2, 3, 4, 5] 
   //sampleEnd
}