drfriendless
09/11/2016, 7:54 PMlistOf(1,2,3).forEach { println("$it") }
In that case, it is 1, 2 or 3 depending on which time around the forEach loop you're up to. $it is the way you embed the toString() of it inside a String constant. You can change the name of it to x by explicitly putting the formal parameter inside the block parameter to forEach, like this:
listOf(1,2,3).forEach { x -> println("$x") }