export class Service {
public validate() {
return async((name: string, dob: string) => {
//do some operation
});
};
public validate() {
return async((name: string, dob: string, address: string) => {
//do some operation
});
};
}
Error: Duplicate function implementation
Typescript Ver: 3.8.3
Is it possible to overload the method in the typescript? if "yes" can anyone help to resolve the above methods?
I think if I suppose your two validate function return different data type such as int and string then you may do something like this.
What if both return number