SOURCE

var areDeeplyEqual = function(o1, o2) {
    let type1 = Object.prototype.toString.call(o1);
    let type2 = Object.prototype.toString.call(o2);
    if(type1 != type2){
        return false;
    }else if(type1 == '[object Object]'){
        if(Object.keys(o1).length != Object.keys(o2).length) return false;
        for(let key in o1){
            if(!o2.hasOwnProperty(key)){
                return false
            }
            if(!areDeeplyEqual(o1[key],o2[key])){
                return false;
            }
             
        }

    }else if(type1 == '[object Array]'){
        if(o1.length != o2.length) return false;
        for(let i=0;i<o1.length;i++){
            if(!areDeeplyEqual(o1[i],o2[i])){
                return false;
            } 
        }
    }else{
        return o1 === o2
    }
    return true;
    
};

let o1 = {"x":null,"L":[1,2,3]}
// let o2 = {"x":null,"L":["1","2","3"]}
let o2 = {"x":null,"L":[1,2,3]}


console.log(areDeeplyEqual(o1,o2))
console 命令行工具 X clear

                    
>
console