Created
November 10, 2015 03:58
-
-
Save itsanna/1ffe96ec122912888346 to your computer and use it in GitHub Desktop.
implementation of intersection method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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