propertyIsEnumerable
Summary
Determines whether a specified property is enumerable.
Syntax
propertyIsEnumerable( proName )
- proName
- Required. String value of a property name.
Examples
var a = new Array("apple", "banana", "cactus");
document.write(a.propertyIsEnumerable(1));
// Output: true
Remarks
The propertyIsEnumerable method returns true if proName exists in object and can be enumerated using a For loop. The propertyIsEnumerable method returns false if object does not have a property of the specified name or if the specified property is not enumerable. Typically, predefined properties are not enumerable, but user-defined properties are always enumerable.
The propertyIsEnumerable method does not consider objects in the prototype chain.
See also
Specification
15.2.4.7 Object.prototype.propertyIsEnumerable (V) ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011
Attributions
Microsoft Developer Network: Article