Drop it help with this challenge

Good evening…
Please, I am having difficulties understanding the topic (Drop It). I tried solving it the way I understood but it was not passing all tests set.
Please can some help me out with a good explanation… thank you.
below is the code I have for my first attempt:

function dropElements(arr, func) {
    return arr.filter(func);
}
console.log(dropElements([1, 2, 3, 9, 2], function(n) {return n > 2; }));

OTHER TESTS PASSED EXCEPT THESE TWO:
dropElements([0, 1, 0, 1] and dropElements([1, 2, 3, 9, 2]
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.

Thank you.

I suggest you reread carefully challenge instructions and try to understand what you are asked to remove from the array and what you are asked to remove - you can’t just use filter here

1 Like

thank you for the heads up