Destructuring in Kotlin
Level 262 keystrokes
Uses a destructuring declaration to unpack a Pair into two variables.
Kotlin code
// (name, age) assigns the Pair's first value to name and the second to age1val (name, age) = Pair("Alice", 30)// Prints Alice2println(name)// Prints 303println(age)Output
Alice 30
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this Kotlin code and how often they appear.
(× 4)× 4,× 2"× 2=× 1