+ 5

what does object mean in js? whats d difference between method and function?

10th Mar 2018, 5:29 PM
2+2=4
2+2=4 - avatar
5 Answers
+ 6
Simply put, if a function is defined inside a class it is a method. If outside then it's a function.
12th Mar 2018, 2:51 AM
Rusty.Metal
10th Mar 2018, 5:41 PM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
+ 3
If u ever had a chance to use java (a pure object oriented programming language) u will notice that there are no functions, but instead they have methods. simply bcoz everything in java are objects. so the thing is that a method is a function that is associated with an object.
11th Mar 2018, 3:59 AM
Lhoussine El manoug
Lhoussine El manoug - avatar
+ 2
method is a type of function in JavaScript.the way corolla is a type of Toyota
19th Aug 2018, 1:15 PM
Wendy Amon
Wendy Amon - avatar