Created
May 1, 2015 22:41
-
-
Save tonyonodi/77b26854e458cb6caef4 to your computer and use it in GitHub Desktop.
Non-awful array comparison
This file contains 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
// compares contents but nor order... which may or may not be what you want | |
var arr1 = [1,2,3], | |
arr2 = [1,2,3]; | |
arr1.every(function(item) { | |
return arr2.indexOf(item) >= 0; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment