Destructuring and Typealias
Destructuring unpacks a data class or pair into variables. typealias gives a type a shorter name.
Example
typealias Scores = Map<String, Int>
val s: Scores = mapOf("Ada" to 90)
val (name, pts) = "Tunde" to 80
println("$name $pts $s")Exercise
Short type name.
Ids = List<Int>Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.