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.

4
  • 7
    I Consider this the "Accepted Answer" for using ES6.
    – mwieczorek
    Commented Jan 10, 2018 at 7:26
  • 12
    @mwieczorek How about: const array3 = [...new Set(array1.concat(array2))] Commented Feb 8, 2018 at 6:05
  • 8
    It doesn't work if you are using an Array of objects
    – carkod
    Commented Sep 25, 2018 at 10:29
  • 1
    for merging different objects without duplicating : stackoverflow.com/a/54134237/3131433 Commented Nov 14, 2019 at 1:33