Positional and Named Record Fields
Read record fields cleanly.
Two Ways to Hold Fields
A record can store positional fields, named fields, or both. The style you pick shapes how you read the values back out.
Positional Fields
List values plain, and they become positional fields. Order is what gives each one its meaning and place.
var pair = (3, 7);
print(pair);All lessons in this course
- Records: Lightweight Tuples
- Positional and Named Record Fields
- Destructuring With Patterns
- switch Patterns and Guards