DEV Community

Discussion on: My confusions about TypeScript

Collapse
 
jwp profile image
John Peters • Edited

In your example you do not need to override the getter for Id. Why? Because it's in the base class. When referring to static properties one must call out the class that contains them.

If each of the static methods are to return the same thing you only need one in the base class. DRY is good.

Collapse
 
kenbellows profile image
Ken Bellows

Each class's idColumn getter returns a different thing, as shown in the example code. That's why I was overriding them.