检查对象是否具有某个属性:这个课程好像出现问题了 不管什么方法好像都不对,

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

let users = {
Alan: {
  age: 27,
  online: true
},
Jeff: {
  age: 32,
  online: true
},
Sarah: {
  age: 48,
  online: true
},
Ryan: {
  age: 19,
  online: true
}
};

function isEveryoneHere(obj) {
// 只修改这一行下面的代码
return obj.hasOwnProperty('Alan','Jeff','Sarah','Ryan')?true:false
// 只修改这一行上面的代码
}

console.log(isEveryoneHere(users));
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36.

Challenge: 检查对象是否具有某个属性

Link to the challenge:

return ‘Alan’ in users&&‘Jeff’ in users&&‘Sarah’ in users&&‘Ryan’ in users;
实在没想到要用这种方法 :joy:

image

1 个赞