Standard built-ins
Object.prototype.propertyIsEnumerable()
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
| Name | Type | Description |
|---|---|---|
| key | String | Symbol | Property key. |
Return Value
Boolean
Own enumerable presence.
Working Example
Example Snippetjavascript
const x={n:1};console.log(x.propertyIsEnumerable("n"),x.propertyIsEnumerable("toString"));