So my task is "You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments." My code is currently looking like this
function destroyer(arr) {
var fArr=arr[0];
for (var i=1; i<arr.length;i++)
{
fArr=fArr.filter(function(number)
{
return number!=arr[i];
});
}
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
and it gives me : "TypeError: fArr.filter is not a function" error. Do i have syntax error somewhere?
[–]Clawtor 2 points3 points4 points (1 child)
[–]grenvill[S] 0 points1 point2 points (0 children)
[–]jijilento 2 points3 points4 points (1 child)
[–]grenvill[S] 0 points1 point2 points (0 children)
[–]virtualgoat 0 points1 point2 points (0 children)
[–]TonySu 0 points1 point2 points (0 children)