reference object method with variables 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
var mycar = new Car('Eagle', 'Talon TSi', 1993);