Can someone give a simple explanation of methods vs. functions in Javascript context? I have not found any answer on stack overflow
Asked
Active
Viewed 711 times
-2
-
https://stackoverflow.com/a/15285702/4281779 – Zakaria Acharki Jul 18 '18 at 17:23
-
1[What's the difference between a method and a function?](//stackoverflow.com/q/155609) – 001 Jul 18 '18 at 17:25
2 Answers
1
I think both are pretty much synonym. However, you might want to use the term Method
when it is a function within an class/object.
You can read more there:
https://softwareengineering.stackexchange.com/questions/20909/method-vs-function-vs-procedure

Wonay
- 1,160
- 13
- 35
1
In a practical sense, absolutely nothing. They are the same.
In a semantic sense, a method is simply a function that belongs to an object or class.
This is the same for pretty much every language out there as well. Another term in the same basket is "sub-routine", which is again, pretty much the same exact thing as a function.

samanime
- 25,408
- 15
- 90
- 139