Seek and Destroy//what am i doing wrong?

Tell us what’s happening:

Your code so far

    var arr1 = [];
    arr1.push(arguments[0].filter(function(x) {
        for (var i = 1; i < arr.length - 1; i++) {
            if (x != arguments[i]) {
                return arguments[i];
            } else {

    return arr1;

destroyer([1, 2, 3, 1, 2, 3], 2, 3);```
**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36```.

**Link to the challenge:**

You have several issues here. Remember that filter returns a new array, so you do not need to push an array into arr1. You could assign the value of the filter to arr1 instead.

Also, the arguments object inside the filter function is different than the arguments object within the destroyer function. You need to figure out how to capture the extra arguments after the first argument (arr) before entering into the for loop, so you loop. Also, your for loop is looping over arr’s length instead of just the number of arguments after the first argument (arr).

Also, for filter to work, you need to return a true or false value.

1 Like