Timeline for How to check if two arrays are equal with JavaScript?
Current License: CC BY-SA 4.0
29 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 28 at 18:02 | history | edited | ninjagecko | CC BY-SA 4.0 | some clarification |
| May 28, 2021 at 0:57 | history | edited | ninjagecko | CC BY-SA 4.0 | clarification on the problem with Sets |
| May 27, 2021 at 18:15 | history | edited | ninjagecko | CC BY-SA 4.0 | link to es6 equality matrix |
| May 27, 2021 at 17:47 | history | edited | ninjagecko | CC BY-SA 4.0 | typo fix: areEquals -> areEqual |
| Feb 18, 2021 at 23:29 | history | edited | ninjagecko | CC BY-SA 4.0 | added 12 characters in body |
| Feb 18, 2021 at 23:19 | history | edited | ninjagecko | CC BY-SA 4.0 | bugfix: cannot depend on .sorting a Map's keys |
| Oct 17, 2019 at 11:16 | review | Suggested edits | |||
| Oct 17, 2019 at 12:23 | |||||
| May 20, 2019 at 14:54 | comment | added | ninjagecko | TheDarkIn1978's suggestion is incorrect for cases like [1,1,2]. | |
| May 7, 2019 at 3:33 | comment | added | Chunky Chunk | function areArraysEqual(a1, a2) { return (a1.length === a2.length && new Set(a1, a2).size === a1.length) ? true : false; } | |
| Aug 30, 2018 at 23:54 | history | edited | ninjagecko | CC BY-SA 4.0 | added 518 characters in body |
| Feb 28, 2018 at 22:08 | history | edited | ninjagecko | CC BY-SA 3.0 | added 242 characters in body |
| May 23, 2017 at 12:02 | history | edited | URL Rewriter Bot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Nov 7, 2016 at 10:08 | history | edited | ninjagecko | CC BY-SA 3.0 | added 124 characters in body |
| Nov 7, 2016 at 7:45 | history | edited | ninjagecko | CC BY-SA 3.0 | added 124 characters in body |
| Oct 25, 2016 at 21:55 | history | edited | ninjagecko | CC BY-SA 3.0 | added 87 characters in body |
| Sep 4, 2015 at 19:02 | history | edited | ninjagecko | CC BY-SA 3.0 | added 242 characters in body |
| Sep 4, 2015 at 18:54 | comment | added | ninjagecko | yes, that's exactly what I already said, though I guess I'll bold it for clarity or something | |
| Aug 19, 2015 at 15:21 | comment | added | runspired | JSON.stringify does not guarantee you that it converts an object to the same string. each time. | |
| Mar 30, 2014 at 4:50 | comment | added | ninjagecko | Oops, it seems back in the day I was in a rush and tricked myself into misreading someone's comment, and so said an irrelevant falsehood (that JSON.stringify(null)=='"null"'). I still do not see a problem in relation to OP's question with respect to any undefineds or nulls that I have not mentioned in my answer. Therefore I stand by my answer and its demo tests. | |
| Mar 30, 2014 at 4:45 | history | edited | ninjagecko | CC BY-SA 3.0 | deleted 77 characters in body |
| Aug 25, 2013 at 16:28 | history | edited | ninjagecko | CC BY-SA 3.0 | added 96 characters in body |
| Aug 25, 2013 at 16:18 | history | edited | ninjagecko | CC BY-SA 3.0 | added 96 characters in body |
| Aug 25, 2013 at 15:57 | history | edited | ninjagecko | CC BY-SA 3.0 | added 96 characters in body |
| Aug 23, 2013 at 18:22 | comment | added | djechlin | JSON.stringify(null) === 'null' (the string "null"), not null. | |
| Sep 14, 2012 at 13:52 | history | edited | ninjagecko | CC BY-SA 3.0 | added 325 characters in body |
| Aug 13, 2012 at 13:37 | history | edited | ninjagecko | CC BY-SA 3.0 | added 235 characters in body |
| Apr 28, 2012 at 13:29 | history | edited | ninjagecko | CC BY-SA 3.0 | deleted 48 characters in body |
| Apr 25, 2012 at 14:08 | comment | added | pimvdb | +1, a little comment: For allTrue, you can also use array.every with a function returning the array element value. | |
| Apr 25, 2012 at 13:22 | history | answered | ninjagecko | CC BY-SA 3.0 |