TypeScript Classes
TypeScript also treats class
es as their own type:
Like function parameters, class
es sometimes have optional members. The same ?:
syntax can be used on a class
definition:
In the above example, an instance of Person
is guaranteed to have a name
, and might optionally have a nickName
Last updated