Object.prototype.propertyIsEnumerable

Determines whether a specified property is enumerable.

Syntax

propertyIsEnumerable(name)

Parameters

Return value

true if the property exists and is enumerable; otherwise, false.

Examples

let obj = {cheese: "like", milk: "dislike"}
obj.propertyIsEnumerable("cheese")
true