Work with Objects

An object is very similar to a list. The key difference is objects have named elements instead of numerically indexed elements. The named elements are called properties.

Assume you have a list containing the name of a special constant and the constant’s value as follows:

x:=["Pi",3.1415]

You can refer to the constant’s name using the expression x[0] and its value using the expression x[1]. However, if you define x as an object as follows:

x:={name:"Pi",value:3.1415}

you can refer to its name using the expression x.name and its value using the expression x.value.