var json={
name:‘小谢‘,
age:‘28‘
}
var a = [];
function extent(child,parent){
for(var attr in parent){
child[attr]=parent[attr];
}
}
extent(a,json);
alert(a.name);
时间: 2024-10-07 05:06:38
var json={
name:‘小谢‘,
age:‘28‘
}
var a = [];
function extent(child,parent){
for(var attr in parent){
child[attr]=parent[attr];
}
}
extent(a,json);
alert(a.name);