We can use key paths to have a reference to a property from an object. For example, in this simple case, we can pass to a method an object and a reference to a property from that object. We have different types of key path references. KeyPath is a read-only reference, but we can pass…