Answer the question
In order to leave comments, you need to log in
How to fix this error in TypeScript?
This overload signature is not compatible with its implementation signature.
function printInc(a: number): void;
function printInc(a: string): void {
switch (typeof a) {
case 'string':
console.log(a + ' plus one');
break;
case 'number':
console.log(a + 1);
break;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question