function destroyer() {
// Remove all the values
console.log(arguments);
var args = Array.prototype.slice.call(arguments,0);
console.log(args);
var firstArray = [];
firstArray = args[0];
var resultArray = firstArray.filter(function(x){
var tmp = true;
for (var i =1;i<args.length ;i++)
{
if(x == args[i])
{
tmp = false;
}
}
console.log(x);
console.log(firstArray);
if(tmp)
{
return x;
}
});
console.log(resultArray);
return resultArray;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Bonfire: Seek and Destroy
最新推荐文章于 2019-03-02 12:02:45 发布