https://www.cnblogs.com/xxmb/archive/2013/11/19/3431118.html
https://www.cnblogs.com/platycoden/p/5204362.html
对于json对象:
var arr={‘a‘:1,‘b‘:2,‘c‘:3};
for (var k in arr){
alert(k+‘ : ‘+arr[k]);
}
对于数组对象:
var arr = [
[10,‘zhangsan‘,‘male‘],
[11,‘lisi‘,‘female‘],
[12,‘wangwu‘,‘male‘]
];
for (var i in arr){
for(var j in arr[i]){
document.write(arr[i][j]);
}
document.write(‘<br>‘);
}
原文地址:https://www.cnblogs.com/maidongdong/p/8315943.html
时间: 2024-11-13 10:06:05