Intermediate Algorithm Scripting: Seek and Destroy practice

Hello everybody,

I am trying to resolve this problem and after some rounds I get it, in fact I have the same results as the examples but it does’t give me as passed, I know that works but why is not valid? Thanks to everybody

function destroyer(arr) {
    // Remove all the values
    let removeList=[...arguments][0];
    let removeElements = [...arguments].slice(1)

    for(var i= 0; removeElements.length >= i; i++){

        console.log(removeElements[i])
        removeList = removeList.filter(value => value != removeElements[i] )

    }

  }
  

when you ask for help please always include the challenge link

but, at a first glance, without being able to test your function, I would say that the issue is that the function doesn’t return anything

apologizes for the mistake, and thanks for the solution, Im struggling a lot with this exercises trying not to find the easy solution.

Thank you very very much !

try to add the return statement and see how well you are doing
you can see what’s the returned value by calling the function in a console.log

console.log(destroyer(...))

I had solved, thanks for your time.

function destroyer(arr) {
    // Remove all the values
    let removeList=[...arguments][0];
    let removeElements = [...arguments].slice(1)

    for(var i= 0; removeElements.length >= i; i++){

        console.log(removeElements[i])
        removeList = removeList.filter(value => value != removeElements[i] )

    }
   

    return removeList
  }