Tell us what’s happening:
Your code so far
function dropElements(arr, func) {
// Drop them elements.
var n,k=0;
var arr1=[];
for(var i=0;i<arr.length;i++){
n=arr[i];
if(func(n)==true){
arr1[k]=n;
k++;
}
}
return arr1;
}
dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;});
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/drop-it