If you take into account that we have an array [1, -2, 3]
By doing the filter first you will remove whichever number are lower than 0 so you will end up with [1, 3] for the map to iterate. (FCC’s solution)
By doing the map first you will be sending to the filter [1, null, 9] which will then be passed to the filter to iterate. (Your solution)
On FCC solution you will loop through an array of length 3 and then trough an array of length 2 so, 5 iterations.
On your solution you will loop through an array of length 3 and then again through length 3 so, 6 iterations.
The less iterations the better, as long as you keep readability of the code.
Note that it can happen for the FCC solution to iterate the same times as your solution either way depending on our array, the important part is that it will iterate less in some scenarios while your solution will always iterate all of the array length twice
If this were a stream or a transducer you could do it all in one sweep tbh. But since this is a library-free environment, you have to manually represent it as a reduce statement:
const filterMap = (pred, mapper, xs) => xs.reduce((result, x) => {
if (pred(x)) result.push(mapper(x))
return result
}, [])