0

What are main differences and similarities between methods in C# and functions in JavaScript?

I am familiar with JavaScript and understand how create and call functions. However I am having a bit of a tough time fully understanding methods in C#. Can anyone give some quick examples that helped them understand it better? The Microsoft docs arent very helpful and their examples are very dry.

18th May 2018, 8:58 PM
Taulant Sulko
Taulant Sulko - avatar
1 Réponse
+ 1
Methods are functions that belong to a class/object they can access private and protected variables and other methods and have to be called from the object unless they’re static other than that JS functions and C# methods are the same.
18th May 2018, 9:53 PM
TurtleShell
TurtleShell - avatar