![]() |
|
|
+ Search |
![]()
|
Apr 12th, 2005 00:51
Martin Honnen,
The method propertyIsEnumerable takes one argument, a property name. The
argument is converted to a string and the method returns true if the
property name is '0' and false otherwise. This is done to intentionally
blur the distinction between an XML object and an XMLList containing one
object.
Here are some examples:
var gods = <gods>
<god>Kibo</god>
<god>Xibo</god>
</gods>;
alert(gods.propertyIsEnumerable('0')); // shows 'true'
alert(gods.propertyIsEnumerable('1')); // shows 'false'
for (var propertyName in gods) {
alert(propertyName);
}
// shows '0'