Skip to content

Instantly share code, notes, and snippets.

@itsanna
Created November 10, 2015 03:58
Show Gist options
  • Save itsanna/1ffe96ec122912888346 to your computer and use it in GitHub Desktop.
Save itsanna/1ffe96ec122912888346 to your computer and use it in GitHub Desktop.
implementation of intersection method
intersection: function (n) {
var argArray = []
var results
this.each(arguments, function(currVal) {
argArray.push(currVal)
})
for (var i = 1; i < argArray.length; i++) {
results = this.filter(argArray[i], function(currVal) {
return this.contains(n, currVal)
})
}
return results
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment