小白 请教 javascript 基础对象 object


#1
let users = {
	  Alan: {
	    age: 27,
	    online: false
	  },
	  Jeff: {
	    age: 32,
	    online: true
	  },
	  Sarah: {
	    age: 48,
	    online: false
	  },
	  Ryan: {
	    age: 19,
	    online: true
	  }
	};
console.log(users.Jeff.online);
function countOnline(obj) {
  // 请把你的代码写在这条注释以下
var count = 0;
for (var use in obj){
	console.log(use.online);    //**在这里输出查看对象online 属性 为什么是underfined呢?**

}
 return count;
}

console.log(countOnline(users));

#2

建议看下 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/for...of

看下 for offor in 的差别