Or here's one...
namespace MyLibrary { public static class func { public static Func<string> junk = () => "junk"; public static Func<string,string> append = (item)=> item + "appended"; public static string append2(this string input){ return input + "appended"; } } } //elsewhere var junk = func.Junk(); var appended = func.append("prefix"); var appended2 = "prefix".append2();
The C# Equivalent of first class functions in Typescript/JavaScript are Extension Methods.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Or here's one...
The C# Equivalent of first class functions in Typescript/JavaScript are Extension Methods.