正确答案在此
function arraysSimilar(arr1, arr2){
if (arr1.length !== arr2.length) {
return false;
}else{
for (el1 of arr1) {
let type1 = Object.prototype.toString.call(el1);
let stepPaired = false;
for (el2 of arr2) {
let type2 = Object.prototype.toString.call(el2);
if (type1 === type2) {
const index = arr2.indexOf(el2);
arr2.splice(index,1);
stepPaired = true;
break;
}
}
if (!stepPaired) {
return false;
}
}
}
return true;
}