Typescript method overloading
kreuzerk
Posted on November 22, 2018
Method overloading is a familiar concept from traditional programming languages like Java or C#. It basically allows a class to have multiple methods with the same name if their signature is different.
But Typescript only helps us during edit and compile time and not at runtime. Therefore method overloading works different. The executed code is still pure Javascript.
Due to the dynamic nature of JavaScript we can’t use overloading in the same way we do in other languages. Find out how method overloading works in TypeScript
💖 💪 🙅 🚩
kreuzerk
Posted on November 22, 2018
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
webdev Mastering the Dependency Inversion Principle: Best Practices for Clean Code with DI
November 28, 2024
javascript Understanding JavaScript and TypeScript: A Comprehensive Guide with Use Cases
November 24, 2024
webdev Why Are Type Guards Necessary? Exploring Different Types and Their Use Cases
November 8, 2024