Lesson 8 of 56
TypescriptFunction Overloads
20 minutes
Course progress14%
Overloading Signatures
When a function behaves differently based on its arguments, you can provide multiple call signatures.
function fn(x: string): string;
function fn(: ): ;
(): {
x === ? x.() : x * ;
}
a = ();
b = ();