//关联数组长度
function getObjLength(obj){
var count=0;
for(var name in obj){
if(typeof obj[name] == "object"){
count+=getObjLength(obj[name]);
}else{
count++;
}
}
return count;
}
网友评论