Let keys=[];
Let keychilds=[];
Let values=[];
For (the let I=0; I & lt; JsonArr. Length; I++) {
JsonArr. ForEach (function (m) {
N in m for (var) {
Keys. Push (n);
M [n]. ForEach (function (h) {
For (var) in h k {
Keychilds. Push (k);
[k] values. Push (h);
}
});
}
});
}
Let data={
https://bbs.csdn.net/topics/Keys: keys,
Keychilds: keychilds,
Values: values,
}
The console. The log (' data ', data);
CodePudding user response:
The period for code to the followingJsonArr. ForEach (e=& gt; {
Keys. Push (... Object. The keys (e));
Object. Values (e). The forEach (se=& gt; {
Keychilds. Push (... Object. The keys (se));
Values. Push (... Object. Values (se));
});
});
CodePudding user response:
What's the problem with this?What do you need?