In Kotlin, if you want to use the element of the forEach, you can use the it keyword. So now I wonder that what should I do if I have a forEach inside forEach like that:
list.forEach {
val parent = it
it.forEach {
// `it` now become the element of the parent.
}
}
I think that defines a new variable only for the naming convention be so stupid. Have any other solution for this problem?