Skip to content

Instantly share code, notes, and snippets.

@jamiehs

jamiehs/gist:3364281

Created Aug 15, 2012
Embed
What would you like to do?
jQuery Array Intersect One Liner
// Find the common intersection between the arrays
a1=[1,2,3]
a2=[2,3,4,5]
$.map(a1,function(a){return $.inArray(a, a2) < 0 ? null : a;})
// http://stackoverflow.com/a/9401775/24559
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment