JS_对象的方法

/*
* o.name 这属性在IE下会返回 undefined, 如果o是匿名函数在标准浏览器下回返回"",非匿名函数会返回函数名.
*/
<
script type="text/javascript"> var o = function(){} o.myage = 18; o.myname = "shao"; o.prototype.show = "hello"; var a = new o(); alert(o.hasOwnProperty("myname"));     //true 检查属性("myname")是否为该对象(o)的静态属性,不考虑原型链属性 alert(o.prototype.isPrototypeOf(a));    //true 检查对象(a)是否为该对象(o)的原型 alert(o.propertyIsEnumerable("myname"));  //true 检查属性("myname")是否能被枚举,不考虑原型链属性 </script>
原文地址:https://www.cnblogs.com/somesayss/p/2783901.html