You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What about supporting c# style extension method? Syntax should be like
classMyClass{publicmyClassId: number;constructor(){this.myClassId=2;}}// extend the class by using c# like syntaxclassExtendMyClass{publicstaticDisplayMyClassId(thismyClass: MyClass){console.log(myClass.myClassId);}}// or just dont use the a class to extend it, just use a functionfunctionDisplayMyClassId(thismyClass: MyClass){console.log(myClass.myClassId);}
I actually prefer the latter one, implementing this should be easy to translate to js since js provide with prototype, export keyword also work with this kind. It would be great if supporting this kind of syntax to use functional programming, like extend a method for a defined type.
The text was updated successfully, but these errors were encountered:
What about supporting c# style extension method? Syntax should be like
I actually prefer the latter one, implementing this should be easy to translate to js since js provide with prototype, export keyword also work with this kind. It would be great if supporting this kind of syntax to use functional programming, like extend a method for a defined type.
The text was updated successfully, but these errors were encountered: