1.用 in 关键字
var a = {name:"yang"}
'children' in a => false
2.hasOwnProperty
var obj = {name:'jack'};
obj.hasOwnProperty('name'); // --> true
obj.hasOwnProperty('toString'); // --> false
3.使用undefined判断
var o={x:1};
o.x!==undefined; //true
o.y!==undefined; //false