87,987
社区成员
发帖
与我相关
我的任务
分享
dataSQ:{
"name0": {
"name01": {
"order": 7,
"user": [
51608
]
},
"name02": {
"order": 1,
"user": [
167536
]
},
"name03": {
"order": 3,
"user": [
169896
]
}
}
}
(arrdata)=>{
let arrdataL = Object.keys(arrdata).length;
let keys=[];//定义一个数组用来接受key
let keys2=[];//定义一个数组用来接受key
let values=[];//定义一个数组用来接受value
let values2=[];//定义一个数组用来接受value
for(var key in arrdata){
keys.push(key);
values.push(arrdata[key]);//取得value
console.log(key);// 输出: name0
console.log(arrdata[key]);// 输出object及内容:Object {__ob__: io}
for(var vv in arrdata[key]){
keys2.push(vv);
values2.push(arrdata[vv]);//数组为空
console.log(" "+vv);输出:name01、name02、name03
console.log(" "+arrdata[key].vv);输出:undefined
console.log(" "+arrdata[vv]);输出:undefined
for(var v2 in arrdata[vv]){
// console.log(‘咳咳 这步还没到’);
}
}
}
}
arr(dataSQ);
arrdata[key].vv
arrdata[key][vv]