object dot notation code example
Example 1: Accessing Object Properties with Dot Notation
//There are two ways to access the properties of an object: dot notation (.)
//and bracket notation ([]), similar to an array.
var myObj = {
prop1: "val1",
prop2: "val2"
};
var prop1val = myObj.prop1; // val1
var prop2val = myObj.prop2; // val2
Example 2: javascript object string property
// Also useful for dynamic strings, e.g. `thing-${variable}`
myObject['thing'] = true;