function json_recursion (jsons,newjson){ // jsons 是你要解析的多维json或数组, newjson 是改变后的值
for(var x in jsons){
if(jsons[x] instanceof Object||jsons[x] instanceof Array){
json_recursion (jsons[x],newjson);
}else{
newjson[x]=jsons[x]; //赋值给新json
}
}
}
var arr = [{"name":"王家三少","xldigitid":123456,"topscore":2000,"topplaytime":"2009-08-20"},{"xlid":"zd","xldigitid":123456,"topscore":1500,"topplaytime":"2009-11-20"}];
var newjson = {};
jsonrecursion (arr,newjson);
console.log(newjson);