Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftKeyPath expressionsSingle-choice MCQ

What is the result of appending these two key paths?

struct Engine { var horsepower: Int } struct Car { var engine: Engine } let kp = (\Car.engine).appending(path: \Engine.horsepower) var c = Car(engine: Engine(horsepower: 100)) c[keyPath: kp] = 200