---
title: "Discussion on \"Three methods to get unique values from arrays in ES6.\" | Hashnode"
description: "Discussion on \"Three methods to get unique values from arrays in ES6.\". There are several ways and several algorithms that you can easily implement to retrieve unique element in an array in JavaScript. In this article, we will discuss three of those ways. This is the first article in The JavaScript Snippet Series. It is ..."
url: "https://hashnode.com/posts/three-methods-to-get-unique-values-from-arrays-in-es6/5e817302ba34afe713b7d267"
---

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

Discussion

# [Three methods to get unique values from arrays in ES6.](https://bytenaija.hashnode.dev/three-methods-to-get-unique-values-from-arrays-in-es6?utm_source=hashnode&utm_medium=feed)

There are several ways and several algorithms that you can easily implement to retrieve unique element in an array in JavaScript. In this article, we will discuss three of those ways. This is the first article in The JavaScript Snippet Series. It is ...

Mar 30, 2020 · bytenaija.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#snippets](https://hashnode.com/tag/snippets)
-   [#es6](https://hashnode.com/tag/es6)
-   [#programming-ciovqvfcb008mb253jrczo9ye](https://hashnode.com/tag/programming-ciovqvfcb008mb253jrczo9ye)
-   [#arrays](https://hashnode.com/tag/arrays)

## Written by

[Everistus Olumese](https://hashnode.com/@bytenaija)

@bytenaija · Toronto/Canada

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

Senior Fullstack Engineer @ jewlr.com

I am a developer from Lagos, Nigeria with over 7 years of professional experience.

## Responses 2

Markdown supported · ⌘↵ to post

[Opeyemi Adeyeye](https://hashnode.com/@opeyemiadeyeye)

[Mar 30, 2020](https://hashnode.com/posts/three-methods-to-get-unique-values-from-arrays-in-es6/5e817302ba34afe713b7d267/comment/5e81c6198267309a3c271bf0)

Nice Read!

You might want to edit your first program implementation as you console **result** variable but there's no where you declared and assigned value to it.

I guess you skipped to assign the function call to result variable like const result = useSet(arr)

[Everistus Olumese](https://hashnode.com/@bytenaija)

[Mar 30, 2020](https://hashnode.com/posts/three-methods-to-get-unique-values-from-arrays-in-es6/5e817302ba34afe713b7d267/comment/5e81c6198267309a3c271bf0#reply-5e81c6f18267309a3c271bfc)

Thank you for the correction. You are quite right and I have edited it

[Bello Hadi](https://hashnode.com/@Alliendeveloper)

[Mar 30, 2020](https://hashnode.com/posts/three-methods-to-get-unique-values-from-arrays-in-es6/5e817302ba34afe713b7d267/comment/5e818cb5ba34afe713b7d2ae)

Am not clear with the second method Array.filter

[Everistus Olumese](https://hashnode.com/@bytenaija)

[Mar 30, 2020](https://hashnode.com/posts/three-methods-to-get-unique-values-from-arrays-in-es6/5e817302ba34afe713b7d267/comment/5e818cb5ba34afe713b7d2ae#reply-5e81ab198570b09f3cacc7d5)

Could you watch the video and let me know if it is still confusing?
