component2

inline operator fun <T> Array<out T>.component2(): T(source)
inline operator fun ByteArray.component2(): Byte(source)
inline operator fun ShortArray.component2(): Short(source)
inline operator fun IntArray.component2(): Int(source)
inline operator fun LongArray.component2(): Long(source)
inline operator fun FloatArray.component2(): Float(source)
inline operator fun DoubleArray.component2(): Double(source)
inline operator fun BooleanArray.component2(): Boolean(source)
inline operator fun CharArray.component2(): Char(source)

Returns 2nd element from the array.

If the size of this array is less than 2, throws an IndexOutOfBoundsException except in Kotlin/JS where the behavior is unspecified.

Since Kotlin

1.0

inline operator fun <T> List<T>.component2(): T(source)

Returns 2nd element from the list.

Throws an IndexOutOfBoundsException if the size of this list is less than 2.

Since Kotlin

1.0

Returns 2nd element from the array.

If the size of this array is less than 2, throws an IndexOutOfBoundsException except in Kotlin/JS where the behavior is unspecified.

Since Kotlin

1.3

inline operator fun <K, V> Map.Entry<K, V>.component2(): V(source)

Returns the value 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
}

Since Kotlin

1.0