December 2001
Intermediate to advanced
480 pages
9h 22m
English
Most of the objects discussed so far and those to be discussed in the rest of the book are defined in an HTML script. However, JavaScript provides a way that you can define your own objects with different properties. Each property can be assigned a value, just as with objects in HTML. The object constructor Object() is used to create user-defined objects using the following format:
var userObj = new Object() After the object has been initialized, you can either add new objects to the existing object or add properties and their values. Consider an organization, the Acme Car Company, with the following five departments and two subdivisions:
Management
Research and Development
Finance
Production
Marketing
Sales
Fulfillment
To create ...
Read now
Unlock full access