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值
猜你喜欢
转载自www.cnblogs.com/Fourteen-Y/p/10487813.html
今日推荐
周排行