how to call object in object javascript code example
Example 1: function inside object javascript
var obj = {
func: function(a, b) {
return a * b;
}
};
obj.func(3, 6); // 18
Example 2: js create object with properties
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}