L
L
lightalex2020-10-26 17:03:01
typescript
lightalex, 2020-10-26 17:03:01

How to override parent class method in TypeScript?

There is a code:

class A {
  m(a: number) { }
}

class B extends A {
  m(a: number, b: string) { }
}


The code editor swears that it is impossible to override the method mwith other arguments:
5f96d6df0fc32680042283.png

Can you please tell me if it is still possible to somehow override the method with a different list of arguments?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question