interface Cat {
meow(words: string): string;
}
interface Cat {
meow(num: number): number;
}
const cat: Cat = {
meow(wordsOrNum): string | number {
return wordsOrNum;
}
}
In the example code above, interfaces demonstrate how declarations can be merged.
However, encountering an error when attempting to implement a function within an object raises the question of its feasibility.