function deepClone(obj){
        var cloneObj=Array.isArray(obj)?[]:{}
        for(key in obj){
            if(typeof obj[key]=="object"){
                cloneObj[key]=deepClone(obj[key])
            }else{
                cloneObj[key]=obj[key]
            }
        }
        return cloneObj
    }
    var obj={
        a:1,
        b:{b:2,c:3},
        c:[1,2,3]
    }
    console.log(deepClone(obj))

WARRIOR
25 声望3 粉丝