fix(filter): throw error if not used with an array

Throw error if filter is not used with an array.

Closes #9992

BREAKING CHANGE: Previously, the filter was not applied if used with a non array.
Now, it throws an error.
I'd like some extra test cases here --- for instance, one with `Object.create(null)`, one with a non-function `toString` and `valueOf` method --- These will work just fine currently, but if the implementation of minErr changes they might need some refactoring later on.

Otherwise it looks pretty good, I'd land this