an object with a property containing a function code example
Example 1: javascript object get property or default
// won't work if obj.property is falsey
let value = obj.property || "default";
Example 2: adding function to objects js
var myObj = {
myFunc: function(param){
//do stuff
}
}
Example 3: js create object with properties
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}