error TS18004: No value exists in scope for the shorthand property ‘age’. Either declare one or provide an initializer.
Broken Code ❌
Fixed Code ✔️
If you want to use the shorthand property name syntax to access the
age property, you have to make sure that this variable is defined in the first place:
Alternatively, you can avoid using the shorthand property name syntax: