JS
See the Pen thecodelog.com - JS Objects 1 by Deano (@deangilewicz) on CodePen.
Or you can use an object literal:
See the Pen thecodelog.com - JS Objects 2 by Deano (@deangilewicz) on CodePen.
Accessing property values on an object can be done in one of two ways:
See the Pen thecodelog.com - JS Objects 3 by Deano (@deangilewicz) on CodePen.
There is no ReferenceError thrown if you try to access an object property on a global object.
See the Pen thecodelog.com - JS Objects 4 by Deano (@deangilewicz) on CodePen.