Function Overloads in Typescript

preview_player
Показать описание
Function Overloads

Some JavaScript functions can be called in a variety of argument counts and types. For example, you might write a function to produce a Date that takes either a timestamp (one argument) or a month/day/year specification (three arguments).

Рекомендации по теме