kamii50,
function sameArrays(...args){
let sum = 0;
const map = {};
args.forEach((arr, i) => arr.forEach( key => {
if(key in map) {
map[key] += i ? -1 : 1;
if(map[key] > -1) sum += i ? -1 : 1;
}
else {map[key] = 1; sum++}
}));
return !sum;
}
console.log(sameArrays([10, 3, 29, 15], [15, 10, 3, 29]))//true
console.log(sameArrays([12, 10, 3], [10, 3, 29, 15]))//false