Letâs continue with
shown in Example 2.2.
ExampleÂ 2-2.Â The Beginning of the questions.js Source Code
This is, of course, an abbreviated version of the file. Array
units is much longer (75 elements in all),
but this shows you that each element of
units is a question object as defined in
question() in lines 1-10.
An object is a set of structured data. Each object can own or have
associated with it two types of entitiesâproperties and
methods. Properties have something, such as the
number 6, the expression
a * b, or the string âJimmy.â
Methods do something, such as calculate ...