Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Array<out T>.component2(): T
operator fun ByteArray.component2(): Byte
operator fun ShortArray.component2(): Short
operator fun IntArray.component2(): Int
operator fun LongArray.component2(): Long
operator fun FloatArray.component2(): Float
operator fun DoubleArray.component2(): Double
operator fun BooleanArray.component2(): Boolean
operator fun CharArray.component2(): Char
operator fun <T> List<T>.component2(): T
@ExperimentalUnsignedTypes operator fun UIntArray.component2(): UInt
@ExperimentalUnsignedTypes operator fun ULongArray.component2(): ULong
@ExperimentalUnsignedTypes operator fun UByteArray.component2(): UByte
@ExperimentalUnsignedTypes operator fun UShortArray.component2(): UShort

Returns 2nd element from the collection.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <K, V> Entry<K, V>.component2(): V

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

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.