Saturday, April 28, 2018

Methods with a fat arrow after the signature instead of curly braces and return statement...

In both C# and TypeScript will be one line long and will return what is immediately after the fat arrow. The return keyword is implicit. Just pretend it leads everything else after the fat arrow. In TypeScript it can be any function and not just the functions that are methods (functions hanging off of JSON objects as properties are "methods" in JavaScript) and what is more, you may wrap what is immediately after the fat arrow in curly braces if you want to explictly use the return keyword which would go where it implictly was implied before. (You'll figure it out.)

No comments:

Post a Comment