---
title: "Discussion on \"3 Ways To Remove Duplicates in an Array with JavaScript\" | Hashnode"
description: "Discussion on \"3 Ways To Remove Duplicates in an Array with JavaScript\". Here are 3 ways you can easily remove duplicates in your data array."
url: "https://hashnode.com/posts/3-ways-to-remove-duplicates-in-an-array-with-javascript/63b81b7a95025da0eecc8703"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [3 Ways To Remove Duplicates in an Array with JavaScript](https://ratracegrad.hashnode.dev/3-ways-to-remove-duplicates-in-an-array-with-javascript?utm_source=hashnode&utm_medium=feed)

Here are 3 ways you can easily remove duplicates in your data array.

Jan 6, 2023 · 2 min read · ratracegrad.hashnode.dev  
Read the article

-   [#2articles1week](https://hashnode.com/tag/2articles1week)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#developer](https://hashnode.com/tag/developer)

## Written by

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

@ratracegrad · Athens, GA, USA

  
[View profile](https://hashnode.com/@ratracegrad)

Senior Software Engineer. Google Developers Expert. Entrepreneur. Mountain Climber. Cat Lover. Gardener. World traveler.

I am a Senior Software Engineer. Google Developers Expert. Entrepreneur. Mountain Climber. Neil Diamond fanatic. Cat lover. Gardener. World traveler.

## Responses 1

Markdown supported · ⌘↵ to post

[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 :-)
