5.13.1. Objects as Collections of Variables

An object is a collection of things bundled together into a single whole. The simplest kind of object is a collection of variables, each having a name.

If x is an object containing a variable called v then x.v is that variable. You can treat it like any other variable. For example, if object duck has a variable called numFeathers, then

  duck.numFeathers = 200;
sets the numFeathers variable in object duck to have value 200.