Expose multiple call signatures with one implementation.
Section: Functions and Parameters
Declare function overloads
typescript
typescript
function format(value: number): string;
function format(value: Date): string;
function format(value: number | Date): string {
return value instanceof Date ? value.toISOString() : value.toFixed(2);
}Explanation
Overloads help when parameter/return relationships are difficult to express with unions alone.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Functions and Parameters