Functions with Records

In this lesson, we will see how functions can interact with the record data structure.

Extracting Values from Records

A function can be used to retrieve or modify field values from a record. As long as the implementation of our function is correct, it will automatically detect the type of the record and access the specified field.

Let’s write a function which retrieves the name and age from the wizardInfo record type we created earlier.

Get hands-on with 1400+ tech skills courses.