Timeline for How to merge two arrays in JavaScript and de-duplicate items
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 24, 2023 at 20:57 | comment | added | tagurit | Archive of the performance tests: web.archive.org/web/20200803234803/http://jsperf.com/… | |
S Sep 20, 2019 at 3:48 | history | suggested | dota2pro | CC BY-SA 4.0 |
typo " = " sign
|
Sep 20, 2019 at 2:37 | review | Suggested edits | |||
S Sep 20, 2019 at 3:48 | |||||
S Sep 20, 2019 at 2:27 | history | suggested | dota2pro | CC BY-SA 4.0 |
code should be put into snippet
|
Sep 19, 2019 at 23:48 | review | Suggested edits | |||
S Sep 20, 2019 at 2:27 | |||||
Jan 4, 2019 at 22:51 | comment | added | Turbo | @TimoHuovinen I added [...new Set(array1.concat(array2))] to slickplaid's jsperf and it is the same speed as lodash which is slow compared to alternatives. Still better than the top answer. (I've never needed to down vote a top answer before.) | |
Oct 18, 2017 at 6:32 | history | edited | Peter Mortensen | CC BY-SA 3.0 |
Active reading. [<https://en.wikipedia.org/wiki/Underscore.js>] Removed meta information (this belongs in comments).
|
S Sep 23, 2015 at 1:09 | history | suggested | Jonathan Lidbeck | CC BY-SA 3.0 |
Updated underscore documentation link (was dead)
|
Sep 23, 2015 at 0:33 | review | Suggested edits | |||
S Sep 23, 2015 at 1:09 | |||||
Apr 22, 2015 at 21:04 | comment | added | barwnikk | Uncaught ReferenceError: _ is not defined I don't want to use any libraries, there is other, easiest way, for example: array.concact(otherArrays); - this is also one line and lot faster. | |
Oct 24, 2014 at 16:37 | comment | added | Johan Olsson | @weaver if you want to pass an array you could just use .apply() | |
Aug 4, 2014 at 14:08 | comment | added | slickplaid | Quick performance take on lodash vs the top answer: jsperf.com/merge-two-arrays-keeping-only-unique-values | |
Aug 2, 2013 at 0:42 | comment | added | Richard Ayotte | @Ygg From the lodash docs. "Returns a new array of unique values, in order, that are present in one or more of the arrays." | |
Feb 9, 2013 at 16:55 | history | edited | GijsjanB | CC BY-SA 3.0 |
added 43 characters in body
|
Feb 9, 2013 at 15:02 | comment | added | Brian M. Hunt | Or, perhaps even better than underscore, the API-compatible lodash. | |
Jan 25, 2013 at 13:15 | comment | added | Ygg | a set would by definition not preserve the order of a merged array because it does not have any order? | |
May 8, 2012 at 13:24 | history | answered | GijsjanB | CC BY-SA 3.0 |