Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks for this and putting the performance numbers in easy to understand ranked % figures. I was originally searching for Set based options because of simplicity. Given my datasets can get very large, performance is definitely a more important consideration!
    – OXiGEN
    Commented Feb 9, 2021 at 23:33
  • 1
    Turns out Set is much faster, especially as the records increase (for Numbers at least). See runnable testers at stackoverflow.com/a/66129415/2578125.
    – OXiGEN
    Commented Feb 10, 2021 at 0:53
  • @OXiGEN Yep, either the browser implementation of Set has been improved, or it depends of the type of data. I should have written my arrays initialization in my answer :(
    – Pitouli
    Commented Mar 1, 2021 at 1:41