1, in运算符
2, hasOwnProperty()
3, != undefined
//检测o对象里是否有属性a
var o={a:1,b:2,c:3};
console.log("a" in o);
console.log(o.hasOwnProperty("a"));
console.log(o.a != undefined);
标签:fine def gpo log define div 一个 post efi
1, in运算符
2, hasOwnProperty()
3, != undefined
//检测o对象里是否有属性a
var o={a:1,b:2,c:3};
console.log("a" in o);
console.log(o.hasOwnProperty("a"));
console.log(o.a != undefined);
标签:fine def gpo log define div 一个 post efi
原文地址:http://www.cnblogs.com/pfcan66/p/8029996.html