August 2017
Intermediate to advanced
440 pages
10h
English
We can omit lambda parameter definitions and access parameters using the it keyword when two conditions are met:
As an example, let's define the properties a and c again, but this time using the implicit name of a single parameter:
val a: (Int) -> Int = { it * 2 } // 1
val c: (String)->Unit = { println(it) } // 2
This notation is really popular in Kotlin, mostly because it is shorter and it allows us to avoid parameter type specification. It also improves the readability of processing defined in LINQ style. This style needs components that have not yet been introduced, ...
Read now
Unlock full access