addOrAppend

fun <T> MutableList<T>.addOrAppend(at: Int, value: T)

Ads value to the list at the specify index, or at the end of the list if that index exceeds the current list length.

Parameters

at

this index

value

to insert or append