Export (0) Print
Expand All

propertyIsEnumerable Method (Object) (JavaScript)

Determines whether a specified property is enumerable.

object. propertyIsEnumerable(proName)

object

Required. Instance of an object.

proName

Required. String value of a property name.

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.

var a = new Array("apple", "banana", "cactus");
document.write(a.propertyIsEnumerable(1));

// Output: true

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Show:
© 2014 Microsoft