javascriptのpropertyIs Enumerableの方法使用紹介


 
/*
propertyIsEnumerable() , , true, false.
1. , .
2. , , for..in .
, true;
*/
function MyObject() {
this.name = " ";
}
var obj = new MyObject();
alert(obj.propertyIsEnumerable("name"));//true
MyObject.prototype.say = " ";
alert(obj.propertyIsEnumerable("say")); //false
for (var i in obj) {
alert(i);//name,age
}