Sometimes you have an array of data and you want to remove all duplicates from the array. In this article, I will show you three ways in which you can do this. 1) Remove duplicates using forEach and includes The Array includes() method determines whe...

Markdown supported · ⌘↵ to post
Philip Birk-Jensen
Great examples!
I like approach 2 the most, a tiny bit slower than #1 (not tested, just a hunch since the
filter()function tends to be slower thanforEach()), but easier to read and understand (a matter of taste).