0/78

Kotlin

You would like to print each score on its own line with its cardinal position. Without using **var** or **val**, which method allows iteration with both the value and its position?

kotlin fun main() { val highScores = listOf(4000, 2000, 10200, 12000, 9030) }

1.

`.withIndex()`

2.

`.forEachIndexed()`

3.

`.forEach()`

4.

`.forIndexes()`

Q 1 / 78

Press C to Clear

Press R to Reset

Press N or Enter to Next or Check answer

Press 1,2,3, ... to toggle answers