Skip to content

Instantly share code, notes, and snippets.

@tonyonodi
Created May 1, 2015 22:41
Show Gist options
  • Save tonyonodi/77b26854e458cb6caef4 to your computer and use it in GitHub Desktop.
Save tonyonodi/77b26854e458cb6caef4 to your computer and use it in GitHub Desktop.
Non-awful array comparison
// 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