getOrNull

Common
JVM
JS
Native
1.0
fun <T> Array<out T>.getOrNull(index: Int): T?
fun ByteArray.getOrNull(index: Int): Byte?
fun ShortArray.getOrNull(index: Int): Short?
fun IntArray.getOrNull(index: Int): Int?
fun LongArray.getOrNull(index: Int): Long?
fun FloatArray.getOrNull(index: Int): Float?
fun DoubleArray.getOrNull(index: Int): Double?
fun BooleanArray.getOrNull(index: Int): Boolean?
fun CharArray.getOrNull(index: Int): Char?

Returns an element at the given index or null if the index is out of bounds of this array.

Common
JVM
JS
Native
1.0
fun <T> List<T>.getOrNull(index: Int): T?

Returns an element at the given index or null if the index is out of bounds of this list.