TS18004
error TS18004: No value exists in scope for the shorthand property ‘
age
‘. Either declare one or provide an initializer.
Broken Code ❌
1 |
|
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:
1 |
|
Alternatively, you can avoid using the shorthand property name syntax:
1 |
|