Both iterate over the collection, one returns values the other doesn't. There's no difference in the iteration part.
People like to make rules on when to use them but I use map, and reduce way more than any other method regardless of mutability. Mutability is a choice of what we do with the data, not the function's themselves. We can choose to mutate or not using just map.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Both iterate over the collection, one returns values the other doesn't. There's no difference in the iteration part.
People like to make rules on when to use them but I use map, and reduce way more than any other method regardless of mutability. Mutability is a choice of what we do with the data, not the function's themselves. We can choose to mutate or not using just map.