The Object
object serves as a basic structure for storing data within your code.
You can create an object and define custom properties for it. For example,
you can create an object named Box and add properties to it, as follows:
var box = new Object();
box.height = 12;
box.width = 18;
box.depth = 16;
You can then retrieve the values of those properties. For example:
response.write(box.height + "<br>");
You can determine whether an object has a particular property by using the hasProperty() method:
if(box.hasProperty("height"))
response.write(box.height + "<br>");
Because the Object object is a prototype for all other objects, the hasProperty() method can be called on any object, including built-in objects.
Constructor
[new] Object([value]) |
The Object object optionally takes an argument that is then converted to an object instance and returned. If no argument is provided, then an Object object instance is still created and returned, but it has no properties defined for it. |
|
Instance Methods
hasProperty |
Checks to see if the calling object has a specified property
|
toString |
Returns a string indicating the object type of the calling object.
|
valueOf |
Returns the object itself.
|
|