TypeScript - Function / Constructor Overloading

TypeScript supports overloading of functions/constructor, but not in the same way as in .Net. Since JavaScript does not provide support of overloading itself, TypeScript enforces strong typing against the various overload signatures at design time, the function name is the same, but the signature of each overload (i.e. their name and parameters, but not the return type) is different. But we still have to write a generalized function that could work in generated JavaScript code, that is compatible with all overloads signatures, and will have only one function implementation.
Posted by: Muhammad Idrees
On 14 Mar 2016 | Views: 561 | Categories: Visual Studio, Tips & Tricks, Other, ASP.NET

Post your comments


Other lins

.Net Techies
Other lins