Created
February 11, 2016 12:22
-
-
Save mildfuzz/dde613f5e499ce2f7dad to your computer and use it in GitHub Desktop.
Compare two arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function arraysAreEqual(a, b) { | |
| if (a.length !== b.length) {return false;} | |
| // remove all index that match, should be zero length array at end if equal | |
| return !a.filter(function(item, index) { | |
| return a[index] !== b[index]; | |
| }).length; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment