Keep getting Boolean not defined for Seek and Destroy challenge

Keep getting Boolean not defined for Seek and Destroy challenge
0

#1

Hi guys!

I’m doing this now and having gone through the basic solution I keep getting ‘boolean is not defined’. Here’s my code:

for (let i=0;i<arr.length;i++){
  for (let j = 0; j<args.length; j++) {
    if ([i]===args[j]){
      delete arr[i];
    }
  }
}
return arr.filter(boolean);
}

Do you guys see what might be causing the problem? Thanks a bunch!


Seek & Destroy - need help understanding (arguments)
#2

Since your code is not the same as the OP of the other thread, I moved your question to a new topic.

You seem to be missing the first part of your function in the code you posted above. The reason you are receiving that error message, is because you put a variable named boolean inside the filter. The filter method is expecting to see a function and not a variable name.


#3

Oh! I understand it now! Thanks a lot @randelldawson!

(I’ll be sure to post the function [i.e. the whole code] in next time too :slightly_smiling_face:)