Standard built-ins

Object.prototype.propertyIsEnumerable()

Try the free JavaScript compiler

Tests whether a property is both own and enumerable. A missing or inherited key returns false. Use an explicit call for null-prototype objects.

Formal Syntax & Structure

javascript syntaxjavascript
object.propertyIsEnumerable(key)

Parameters & Attributes

NameTypeDescription
keyString | SymbolProperty key.

Return Value

Boolean

Own enumerable presence.

Working Example

Example Snippetjavascript
const x={n:1};console.log(x.propertyIsEnumerable("n"),x.propertyIsEnumerable("toString"));
JavaScript Reference