let arr = ["a","b"];
let obj={
    name:'Lucy',
    age:21,
    address:'北京',
    school:'清华大学'
}
for (a in obj) {//for...in遍历的是Object(包括Array)中的可枚举的属性
    console.log("for in:"+a);//1,2
}

for (a of obj) {//for ... in语句以任意顺序迭代对象的可枚举属性。
    console.log("for of:"+a);//a,b
}
03-26 12:19