Below is the class that I have created:
export class MyItem {
public name: string;
public surname: string;
public category: string;
public address: string;
constructor();
constructor(name:string, surname: string, category: string, address?: string);
constructor(name:string, surname: string, category: string, address?: string) {
this.name = name;
this.surname = surname;
this.category = category;
this.address = address;
}
The error message I am receiving is as follows:
Overload signature is not compatible with function implementation
I have attempted various ways to overload the constructor method, including the most recent attempt shown above (found from a source on here).
Despite all my efforts, I continue to encounter the same error. Can you spot what is incorrect in my code?