我有像 newarr 这样的 json 数组名称。如何从 json 数组中获取所有 id 以及如何在 arr 值中添加?
var arr=new Array();
var newarr=new Array([
{
"id": 16820,
"value": "abcd",
"info": "Centre"
},
{
"id": 18920,
"value": "abcd-16820",
"info": "Centre"
},
{
"id": 1744,
"value": "abcd-16820",
"info": "Centre"
},
{
"id": 16822,
"value": "AaronsburgPA-16820",
"info": "Centre"
}
]);