任何人都可以帮我解决这个问题吗? 我有JSON对象,如下所示
[
{"app_Welcome": "Welcome"},
{"app_Notifications": "Notifications"},
{"app_New": "New"}
]
我希望将其转换为对象数组
{{1}}
谢谢!
答案 0 :(得分:-1)
var a = {
"app_Welcome": "Welcome",
"app_Notifications": "Notifications",
"app_New": "New"
};
var result = [];
for( var property in a) {
var obj = {};
obj[property] = a[property];
result.push( obj );
}
console.log(result);