As found on this blog post (which also does the same kind of tests):
If you read the documentation for
filter, you will see why it’s so much slower.
- It ignores deleted values and gaps in the array
- It optionally sets the execution context of the predicate function
- It prevents the predicate function from mutating the data