06/20/2022, 10:01 AM
How to initiate array items using for loop in Kotlin Python allows programmers to perform such an operation: mylist = [1, 2] items = [value * 2 for value in namelist] How can I achieve the same using Kotlin, I want to pass values multiplied by 2 from mylist into the array below: val mylist = mutableListOf(1, 2) val (first, second) = arrayOf( ) Kotlin allows us to to declare and initiate variables with one liners as below val (first, second) = arrayOf(1, 2) that way you can call first or second as a variable. Am trying to make the equal part...