function destroyer2(arr) {
const valsToRemove = Object.values(arguments).slice(1);//获取所有参数的值
console.log(arguments)
return arr.filter(currentStr => valsToRemove.indexOf(currentStr) === -1)
}
function destroyer(arr,...valsToRemove) {
return arr.filter(currentStr => valsToRemove.indexOf(currentStr) === -1)
}
destroyer2 ([1, 2, 3, 1, 2, 3], 2, 3, 4, 5, 6);
Object.values(arguments)
于 2024-07-19 17:27:47 首次发布