var obj = {name:'张三',age:18};
obj.hasOwnProperty('name'); // --> true
obj.hasOwnProperty('id'); // --> false
js 判断对象中是否包含某个属性
猜你喜欢
转载自blog.csdn.net/hello_world_1996/article/details/118027280
今日推荐
周排行