interface Dog {
speak(words: string): string;
}
interface Dog {
speak(num: number): number;
}
const dog: Dog = {
speak(wordsOrNum): string | number {
return wordsOrNum;
}
}
Interfaces are implemented as in the example code above, and declarations are merged.
However, when I try to implement a function in an object, an error occurs. Is this part possible?

wordsOrNum: unknownin the implementation