Created
January 1, 2013 20:39
-
-
Save hughfdjackson/4429869 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var intersectWith = function(a, b, fn){ | |
| return a.filter(function(i){ | |
| return b.some(fn.bind(null, i)) | |
| }) | |
| } | |
| intersectWith([1, 2, 3, 4], [{id: 3}], function(a, b){ return a == b.id }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment