Tell us what’s happening:
I think my code shoud work, but it doesnt.
Your code so far
function dropElements(arr, func) {
let final = arr.filter(num => {
if(func(num)) {
return num
}
})
console.log(final)
return final
}
dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
.
Challenge: Drop it
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it