我的 JSON 响应中有子列表,如
"sublist" : {
"102" : "Core_Java(23)",
"103" : "Oracle(12)",
"111" : "Ruchek(15)",
"104" : "IST-Examportal(20)",
"105" : "CyberSecurity(30)"
}
我想变成这样
var jsonSource = '[{
"ID" : 102,
"SUBNAME" : "Core_Java(23)"
}, {
"ID" : 103,
"SUBNAME" : "Oracle(12)"
}, {
"ID" : 111,
"SUBNAME" : "Ruchek(15)"
}, {
"ID" : 104,
"SUBNAME" : "IST-Examportal(20)"
}, {
"ID" : 105,
"SUBNAME" : "CyberSecurity(30)"
}
]';
帮助我使用 JavaScript 做到这一点。