var obj = {};
for(var k in obj) {
//遍历对象,k即为key,obj[k]为当前k对应的值
console.log(obj[k]);
}
例如:
obj = {name:lee, age:23, sex:'女' }
obj对象有多个key-->value值。
var obj = {};
for(var k in obj) {
//遍历对象,k即为key,obj[k]为当前k对应的值
console.log(obj[k]);
}
obj = {name:lee, age:23, sex:'女' }