How to modify the value in Type

I created a type named newUser, and set the name to Alice and the age to 20. Now I want to change the name in newUser to Bob. Is there any way?

type User={
    name:Text;
    age:Int;
};  
public func addUser(){
    var newUser:User={
        name="Alice";
        age=20;
    };
   //How to change the name of newUser
};
type User={
    var name:Text;
    age:Int;
};  

Make the name property a variable.

1 Like