通过测试了
function arraysSimilar(arr1, arr2){
if(arr1.length!=arr2.length){
return false;
}
for(var i = 0;i<arr1.length;i++){
var el = arr1[i];
var index = arr2.findIndex(ele=>el===null||ele===null?ele===el:
Object.prototype.toString.apply(ele)===
Object.prototype.toString.apply(el))
if(index==-1){
return false;
}
arr2.splice(index,1);
}
return true;
}