JavaScript Object propertyIsEnumerable() Method (original) (raw)

Last Updated : 29 May, 2023

The propertyIsEnumerable() method returns a Boolean indicating whether the specified property is enumerable and is the object's own property. The propertyIsEnumerable() method returns false if the object doesn't have the specified property.

Syntax:

obj.propertyIsEnumerable(prop)

Parameters: This method accepts a single parameter.

Return value: This method returns a boolean value.

Example 1: This example shows the basic use of the JavaScript Object.prototype.propertyIsEnumerable() method.

javascript `

`

Output:

true true false

Example 2: The following example illustrates the enumerability of user-defined vs. built-in properties:

javascript `

`

Output:

true false false false

We have a complete list of Javascript Object Methods, to check those please go through the Javascript Object Complete Reference article.

Supported Browser: