For some reason, if I put that filter on the same line as the return arr, it passes, something like:
return arr.filter((e)=> // ...
The map seems to be fine where it is.
Why? I don’t know. It doesn’t matter for JS, but I guess it does for the test that was written for this. To me, the way you wrote it is easier to read. (With the exception of the semicolon after the map being on the next line.)
I suspect that if you ever work in a company and start doing that, you’ll come out after work to find your tires slashed.
Once you get to the point that you are doing local development, I’d recommend using a linter to catch things like that and enforcing a “standard” format, like airbnb. It just becomes a habit and it will make it much easier to get along with other developers.