sumBy

Common
JVM
JS
Native
1.0
@DeprecatedSinceKotlin("1.5") inline fun <T> Array<out T>.sumBy(
    selector: (T) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun ByteArray.sumBy(
    selector: (Byte) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun ShortArray.sumBy(
    selector: (Short) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun IntArray.sumBy(
    selector: (Int) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun LongArray.sumBy(
    selector: (Long) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun FloatArray.sumBy(
    selector: (Float) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun DoubleArray.sumBy(
    selector: (Double) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun BooleanArray.sumBy(
    selector: (Boolean) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") inline fun CharArray.sumBy(
    selector: (Char) -> Int
): Int

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") @ExperimentalUnsignedTypes inline fun UIntArray.sumBy(
    selector: (UInt) -> UInt
): UInt

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") @ExperimentalUnsignedTypes inline fun ULongArray.sumBy(
    selector: (ULong) -> UInt
): UInt

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") @ExperimentalUnsignedTypes inline fun UByteArray.sumBy(
    selector: (UByte) -> UInt
): UInt

(source)
Deprecated: Use sumOf instead.
@DeprecatedSinceKotlin("1.5") @ExperimentalUnsignedTypes inline fun UShortArray.sumBy(
    selector: (UShort) -> UInt
): UInt

(source)
Deprecated: Use sumOf instead.

Returns the sum of all values produced by selector function applied to each element in the array.

Common
JVM
JS
Native
1.0
@DeprecatedSinceKotlin("1.5") inline fun <T> Iterable<T>.sumBy(
    selector: (T) -> Int
): Int

(source)
Deprecated: Use sumOf instead.

Returns the sum of all values produced by selector function applied to each element in the collection.