+ 1

what are differences between javascript object and object mathod?

7th Dec 2016, 12:43 PM
safayet
2 Answers
+ 3
Object is a member of a class. An object method is a function used on an object.
10th Dec 2016, 4:09 AM
Tom Bertino, Jr
Tom Bertino, Jr - avatar
0
Objects are a collection of properties and methods. Properties are key/value pairs, the value can be any primitive type(string, number, Boolean, null, undefined) or any object(arrays, functions, objects). If the properties value is a function we call it a method. It works like this: obj { prop: "string"; meth: function(x) { console.log(x); }; } obj.meth("rtfm!");
11th Jan 2017, 11:13 PM
tired