SOURCE

function deepClone(obj) {
    if (typeof obj !== 'object' || obj === null){
        return obj
    }
    let copy = {}
    if(Array.isArray(obj)){
        copy = []
    }
    for(key in obj){
        if(obj.hasOwnProperty(key)) {
            copy[key] = deepClone(obj[key])
        }
    }
    return obj
}
console 命令行工具 X clear

                    
>
console