Skip to content

Instantly share code, notes, and snippets.

@javierguerrero
Created March 12, 2015 20:31
Show Gist options
  • Save javierguerrero/bde757f4feabb33da8b3 to your computer and use it in GitHub Desktop.
Save javierguerrero/bde757f4feabb33da8b3 to your computer and use it in GitHub Desktop.
Comparing two arrays and getting the non duplicate(not unique) values
<script type="text/javascript">
var arr1=[1,2,3,4,5];
var arr2=[3,4,5,7,8,9,6];
$(document).ready(function(){
var arr=$(arr1).not(arr2).get();
alert(arr.length);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment