<Kotlin - mutableList always returns empty list> I...
# stackoverflow
u
Kotlin - mutableList always returns empty list I'm using a range with an inline transform so that I can have a list of values and that I want to send it to a method in forEach. But, somehow I see that is not happening. This is the example code I'm using var valuesList: List = mutableListOf() (1..5).map { valuesList.plus(Test(, Instant.now()) // Have a condition to check the value and using the value in next statement valuesList.plus(Test(, Instant.now()) }.forEach { } Somehow I always see valuesList as empty list. Can anyone...