Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove duplicate values: Set #411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

docs: remove duplicate values: Set #411

wants to merge 1 commit into from

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.

None yet

3 participants