---
title: "Comment by Philip Birk-Jensen on \"3 Ways To Remove Duplicates in an Array with JavaScript\" | Hashnode"
description: "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 than forEach() ),"
url: "https://hashnode.com/posts/3-ways-to-remove-duplicates-in-an-array-with-javascript/63b81b7a95025da0eecc8703/comment/63b82fb2624134a0c9b338a8"
---

[Discussion](https://hashnode.com/posts/3-ways-to-remove-duplicates-in-an-array-with-javascript/63b81b7a95025da0eecc8703)

Comment [3 Ways To Remove Duplicates in an Array with JavaScript](https://hashnode.com/posts/3-ways-to-remove-duplicates-in-an-array-with-javascript/63b81b7a95025da0eecc8703)

[Philip Birk-Jensen](https://hashnode.com/@BirkAndMe)

[Jan 6, 2023](https://hashnode.com/posts/3-ways-to-remove-duplicates-in-an-array-with-javascript/63b81b7a95025da0eecc8703/comment/63b82fb2624134a0c9b338a8)

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 than `forEach()`), but easier to read and understand (a matter of taste).

[Jennifer Bland](https://hashnode.com/@ratracegrad)

[Jan 6, 2023](https://hashnode.com/posts/3-ways-to-remove-duplicates-in-an-array-with-javascript/63b81b7a95025da0eecc8703/comment/63b82fb2624134a0c9b338a8#reply-63b8ae77624134a0c9b37f20)

Philip,

#3 is my favoriate :-)
