home / experts / javascript / column79 |
|
Querying an Object's PropertiesJavaScript provides you with a way to loop over an object's properties. You can use this loop technique to find out the names of an object's properties. The looping is done with a
where objName is the name of your object. In the following example we use the for loop to print ken's employee properties (
Try it. You will get two alert boxes: one for Use the
An object's property may be enumerable. An enumerable property can assume only predefined values from a given list. The variable
It can assume one of three values only:
You can verify that indeed
The parameter of the method above should be numeric. Try it (IE 5.x and up, Netscape 6 and up). Next: How to compare JavaScript and Java |
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: March 12, 2001
Revised: March 12, 2001
URL: http://www.webreference.com/js/column79/9.html