error TS2540: Cannot assign to ‘
name‘ because it is a read-only property.
Broken Code ❌
Fixed Code ✔️
user object has been initialized with a const assertion, indicating to the compiler that the object is immutable. If you wish to reintroduce mutability, you have to remove the const assertion: