Javascript propertyIsEnumerable method usage
- 2020-03-30 02:37:10
- OfStack
function MyObject() {
this.name = " I am an instance property ";
}
var obj = new MyObject();
alert(obj.propertyIsEnumerable("name"));//true
MyObject.prototype.say = " I am a property of the stereotype ";
alert(obj.propertyIsEnumerable("say")); //false
for (var i in obj) {
alert(i);//name,age
}