DEV Community

Discussion on: Basic Javascript: Removing Duplicates from an Array

mellen profile image
Matt Ellen • Edited on

While your map example works (apart from the variable name new), I would say that's really a reduce solution.

arr.reduce((acc, item) => 
                         return acc;
                       }, []);

I wouldn't use map for this, as it's not a straight, per item transform.

Took me a minute to figure out your fitler example :D