function mark(p, level){
if(level >3){
return ;
}
if(typeof p == "object" && p != null && p.marked == undefined){
p.marked = true;
console.log(p);
for(var prop in p){
mark(p[prop], level+1);
}
}
}
var g1={name:"xiaoming"};
function func1(){
return {name:"xiaohua"};
}
var l2 = func1();
mark(window, 1);
时间: 2024-10-15 17:04:11