propertyIsEnumerable () is used to detect whether a property belongs to an object, if detected, returns TRUE, otherwise returns false, the following describes its specific use
The code is as follows:/* propertyisenumerable () is used to detect whether a property belongs to an object, if detected, returns TRUE, otherwise returns false. 1. This attribute must belong to the instance and is not part of the prototype. 2. This attribute must be enumerable, that is, a custom property that you can use for ... In the loop. Returns true as long as the above two requirements are met; /function MyObject () {this.name = "I am an instance of attribute"; var obj = new MyObject (); Alert (obj.propertyisenumerable ("name"));//true MyObject.prototype.say = "I am the archetypal attribute"; Alert (obj.propertyisenumerable ("say")); False for (var i in obj) {alert (i);//name,age}