Skip to content

docs: remove duplicate values: Set#411

Open
coderaiser wants to merge 1 commit intophuocng:masterfrom
coderaiser:patch-1
Open

docs: remove duplicate values: Set#411
coderaiser wants to merge 1 commit intophuocng:masterfrom
coderaiser:patch-1

Conversation

@coderaiser
Copy link

Added example using Set:

const removeDuplicate = arr => Array.from(new Set(arr));

@robinpokorny
Copy link
Contributor

Hey, this whole entry is a duplicate of https://1loc.dev/#get-the-unique-values-of-an-array

I'd say we should remove remove duplicate values as the best solution is what @coderaiser proposed and which is already in the other entry.

@elkarouani
Copy link
Contributor

As I see about the "remove duplicate values" post, its purpose is to remove every element that is repeated in the array and returning the list that contains every element doesn't repeated in the input list.

@robinpokorny
Copy link
Contributor

Hey @elkarouani, thank you. You’re absolutely right, this is a different function.
Then this PR should be closed as the proposed solution does something different.
I also think that this function should be renamed. Something along the lines removeRepeated or keepNonRepeated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants