Sobes.tech
Junior — Senior

What text will be displayed? (example 19)

livecode

Task condition

In Swift, structures are value types. When one variable is assigned to another, a copy is created. In the given example, a Human structure with a name field is created. Then, the object is copied, and the name of the copy is changed. It is necessary to determine what value will be printed at the end.

struct Human {
    var name: String
}

var personA = Human(name: "Mike")
var personB = personA
personB.name = "Jack"

print(personA.name)