---
title: "Discussion on \"How to remove the duplicate Elements from an array in JavaScript ?\" | Hashnode"
description: "Discussion on \"How to remove the duplicate Elements from an array in JavaScript ?\". const numArray = [0,1,1,2,2,2,3,3,5,5,5] // input\n//expected output [0,1,2,3,5]\n\n\nUsing the indexOf & filter method\n indexOf: MDN says, the indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is no..."
url: "https://hashnode.com/posts/how-to-remove-the-duplicate-elements-from-an-array-in-javascript/64634de1292efa272d4e3ced"
---

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

Discussion

# [How to remove the duplicate Elements from an array in JavaScript ?](https://mohdasifabid.hashnode.dev/how-to-remove-the-duplicate-elements-from-an-array-in-javascript?utm_source=hashnode&utm_medium=feed)

const numArray = \[0,1,1,2,2,2,3,3,5,5,5\] // input //expected output \[0,1,2,3,5\] Using the indexOf & filter method indexOf: MDN says, the indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is no...

May 16, 2023 · 3 min read · mohdasifabid.hashnode.dev  
Read the article

-   [#problem-solving-skills](https://hashnode.com/tag/problem-solving-skills)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#array](https://hashnode.com/tag/array)
-   [#indexof](https://hashnode.com/tag/indexof)
-   [#javascript-map](https://hashnode.com/tag/javascript-map)

## Written by

[Mohd Asif](https://hashnode.com/@mohdasifdev)

@mohdasifdev · New Delhi

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

learning to live!

A history student &amp; researcher turned frontend developer.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
