function ergodic(obj,indentation){
" 縮排;
if(obj.constructor == Array || obj.constructor == Object){
for(var p in obj){
or for(var p in obj){
or = = 陣列|| obj[p].constructor == 物件){
console.log(indent "[" p "] => " typeof(obj) "");
{");
遍歷(obj[p], indent);
console.log(indent "}");
console.log(indent "}");
console.log(indent "}");
> console.log(indent "[" p "] => '" obj[p] "'");
} else {
. p] "");
}
}
}
}
function print_r(obj) {
console.log( obj, "");
console.log("}")
}
var Stu = {'name':'Alan','grade':{'中文': 120, '數學':130,'比賽':{'NOI':'一等獎'}}};
print_r(stu);