Languages
[Edit]
EN

TypeScript - class methods overloading

7 points
Created by:
Mariam-Barron
811

In this article, we would like to show how to overload method in class in u>TypeScript.

TypeScript supports function overloading syntax that lets to deflate multiple functions with the same name, different arguments and return types. It is required just to provide some functions declarations and one function definition inside class.

Quick solution:

 

Practical example

Edit

Output:

 

See also

Edit
  1. TypeScript - function overloading

Alternative titles

  1. TypeScript - class method overloading
  2. TypeScript - class functions overloading
  3. TypeScript - class function overloading
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join