The Order of the Property Listings

Site Navigation 

The script reports the properties of the object it tests in a predefined order. First it uses its list of possible property names and reports any return values that are not undefined. The list is in alphabetical order so the main property listing is in alphabetical order.

If the object was found to have a length property, that property was (typeof object.length == "number") and the length was greater than zero, then the integer values between 0 and (object.length - 1) are tested as properties of the object and any non-undefined values that are returned are reported.

During the set-up phase of the script all of the Element nodes on the page are tested to see if any have either name or ID attributes. Lists of names and IDs found are generated and the values in the IDs list are tried as properties of the object and reported. Followed by values in the names list.

Finally, a for(var x in object) loop is executed. Any property names enumerated are checked to see if they already appear in the list of properties and, if they do not, are tested as properties of the object and non-undefined values are reported.

© Richard Cornford 2004