Now I will ask you another question which could make you rethink your entire algorithm.
What if you were told that the array passed (the first argument) into the function could have a million elements and the number of additional arguments could be 100,000. Would another solution be more efficient in terms of speed? Let’s assume that memory is not a factor, see if you can think of a different solution which does not iterate over the additional arguments (like indexOf, includes or any kind of for or while loops would do) during each iteration of the filter.
Hint: Think lookup table (something you have already learned on FCC) or even better - Memoization