operator fun <T> Array<out T>.component1(): T
operator fun ByteArray.component1(): Byte
operator fun ShortArray.component1(): Short
operator fun IntArray.component1(): Int
operator fun LongArray.component1(): Long
operator fun FloatArray.component1(): Float
operator fun DoubleArray.component1(): Double
operator fun BooleanArray.component1(): Boolean
operator fun CharArray.component1(): Char
@ExperimentalUnsignedTypes operator fun UIntArray.component1(): UInt
@ExperimentalUnsignedTypes operator fun ULongArray.component1(): ULong
@ExperimentalUnsignedTypes operator fun UByteArray.component1(): UByte
@ExperimentalUnsignedTypes operator fun UShortArray.component1(): UShort
Returns 1st element from the array.
If the size of this array is less than 1, throws an IndexOutOfBoundsException except in Kotlin/JS where the behavior is unspecified.
operator fun <T> List<T>.component1(): T
Returns 1st element from the list.
Throws an IndexOutOfBoundsException if the size of this list is less than 1.
operator fun <K, V> Entry<K, V>.component1(): K
Returns the key component of the map entry.
This method allows to use destructuring declarations when working with maps, for example:
for ((key, value) in map) {
// do something with the key and the value
}
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/component1.html