JavaScript propertyIsEnumerable() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

obj.propertyIsEnumerable(prop) returns true when prop is an own property and its enumerable flag is true.

Inherited properties return false, even if they are enumerable on the prototype. Non-enumerable own properties also return false.

Syntax

Call obj.propertyIsEnumerable() like this. Start with this line.

JavaScript
obj.propertyIsEnumerable(prop)
CallWhat it does
obj.propertyIsEnumerable("name")True if name is own and enumerable.
obj.propertyIsEnumerable("toString")Usually false — inherited and/or non-enumerable.
Object.keys(obj)Lists only own enumerable string keys — the same group that returns true here.

Only own properties can return true. Built-in methods are usually non-enumerable.

Library declarations
JavaScript
obj.propertyIsEnumerable(prop)
JavaScript
object.propertyIsEnumerable(v: PropertyKey): boolean

Parameters

ParameterDescription
propRequired. The property name or Symbol to test.

Return Value

Return ValueDescription
booleantrue if the property is own and enumerable; otherwise false.

JavaScript Examples

Check a Normal Own Property

Plain object fields are enumerable by default.

JavaScript
var user = { name: "Ada", age: 36 };

console.log(user.propertyIsEnumerable("name"));
console.log(user.propertyIsEnumerable("age"));
console.log(Object.keys(user));
Try It Yourself

How It Works

  1. Default enumerable. Normal assignments create enumerable own properties.
  2. Both true. name and age return true.
  3. Keys agree. Object.keys lists the same enumerable own names.

Non-Enumerable Own Property

Define a hidden own property and compare checks.

JavaScript
var box = {};
Object.defineProperty(box, "secret", {
  value: 42,
  enumerable: false
});

console.log(box.secret);
console.log(box.propertyIsEnumerable("secret"));
console.log(Object.keys(box));
console.log(Object.getOwnPropertyNames(box));
Try It Yourself

How It Works

  1. Value exists. You can still read box.secret.
  2. Not enumerable. propertyIsEnumerable returns false.
  3. Keys skip it. Object.keys is empty, but getOwnPropertyNames still finds secret.

Inherited Properties Return false

Even an enumerable prototype property is not “own enumerable” on the child.

JavaScript
var proto = { role: "guest" };
var user = Object.create(proto);
user.name = "Ada";

console.log(user.propertyIsEnumerable("name"));
console.log(user.propertyIsEnumerable("role"));
console.log(proto.propertyIsEnumerable("role"));
Try It Yourself

How It Works

  1. Own field. name is own and enumerable on user.
  2. Inherited field. role is not own on user, so the result is false.
  3. On the proto. Calling the method on proto shows role is enumerable there.

Browser & Runtime Support

propertyIsEnumerable() dates back to early JavaScript (ES1) and is Baseline everywhere.

✓ ES1 · Baseline

obj.propertyIsEnumerable()

Supported in all browsers and runtimes. Handy when teaching enumerable vs non-enumerable keys.

100% Browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Object.prototype.propertyIsEnumerable Excellent

Bottom line: Use freely. For full property details, prefer Object.getOwnPropertyDescriptor.

Frequently Asked Questions

It returns true only when the property is own and marked enumerable.
The method only looks at own properties. Inherited keys always return false here.
Object.keys lists own enumerable string keys — the same properties that return true from propertyIsEnumerable for string names.
Use Object.defineProperty with enumerable: false.
Yes. Pass the Symbol. Own enumerable Symbol properties can return true.

Next: toLocaleString()

Turn an object into a locale-aware string.

toLocaleString() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful