Skip to content

Instantly share code, notes, and snippets.

@kyledecot
Created June 19, 2012 15:49
Show Gist options
  • Save kyledecot/2954926 to your computer and use it in GitHub Desktop.
Save kyledecot/2954926 to your computer and use it in GitHub Desktop.
jQuery.without
$.without = function(first, second) {
return $.grep(first, function(n, i){
return $.inArray(n, second) == -1;
});
};
// Usage...
console.log($.without([1,2,3,4,5], [4,5]));​​ // [1,2,3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment