component1
operator fun ByteArray.component1(): Byteoperator fun ShortArray.component1(): Shortoperator fun IntArray.component1(): Intoperator fun LongArray.component1(): Longoperator fun FloatArray.component1(): Floatoperator fun DoubleArray.component1(): Doubleoperator fun BooleanArray.component1(): Booleanoperator fun CharArray.component1(): Char@ExperimentalUnsignedTypes operator fun ULongArray.component1(): ULong@ExperimentalUnsignedTypes operator fun UByteArray.component1(): UByte@ExperimentalUnsignedTypes operator fun UShortArray.component1(): UShortReturns 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(): TReturns 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(): KReturns 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
}