|
|
|
|
|
by 4rt
2756 days ago
|
|
There's a couple of things going on that you might not be familiar with as it's a bit different to most languages: The public modifier on these constructor parameters is actually introducing them as properties of the Student type: constructor(public firstName: string, public middleInitial: string, public lastName: string) {} Since the Student type has 'firstName' and 'lastName' properties, it meets the Person interface requirements. It doesn't need to declare that it is, but could and usually would just for readability and the additional assurance that you haven't forgotten something. |
|