var testObj = {
'a':'111',
'b':'222',
'c':'333',
'd':'444'
}
for(var i in testObj){
console.log(i);//a,b,c,d
}
for(var i in testObj){
console.log(testObj[i]);//111,222,333,444

js for in循环遍历对象,获取key:value值-LMLPHP

05-02 07:20