Just a short metaphysical question. What is the advantage of using filter() over map()? I have just started the iterators in the JS chapter and the way I see it, if we add a IF to a map() function, we can get the same result.
Is there something that I am severely missing here? Or it’s just for convenience, quicker and easier to use the filter() function?