What's the difference between method and function in JavaScript ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What's the difference between method and function in JavaScript ?

2nd Sep 2019, 5:37 PM
Innocent Chobesha
Innocent Chobesha - avatar
2 Answers
+ 5
From https://dev.to/tiffany/what-is-the-difference-between-a-function-and-a-method-in-javascript-3mkj "In short: a method is a function that belongs to a class. In JavaScript, however, a method is a function that belongs to an object."
2nd Sep 2019, 7:24 PM
Ole113
Ole113 - avatar
+ 1
Ole113 thank you very very much it's a really good explanation (I see the difference between Java and Javascript )
2nd Sep 2019, 7:35 PM
Innocent Chobesha
Innocent Chobesha - avatar