|
|
|
|
|
by styfle
2760 days ago
|
|
Great question! No, you don't need to inherit or implement which is one of the great features of TypeScript! In this example, the `greeter` function accepts any object that has a `firstName` and `lastName` property defined, regardless of what the object/type is called. No need for inheritance. In fact, the `Person` interface is not even emitted in the JS output because interfaces are only used at compile time, not at run time. |
|