A Pen by Pete Wildsmith on CodePen.
Last active
August 29, 2015 14:13
-
-
Save weargoggles/798d0a9c7e4070cd4b50 to your computer and use it in GitHub Desktop.
ByRggV
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
var list = Immutable.List([{ x: 1} , {x: 2},{x: 3}]), list2 = Immutable.List([{ foo: 3} , {foo: 6},{foo: 9}]); | |
document.write( | |
"<p>", !!list | |
.map(function (x) { return x.x; }).toSet() | |
.intersect(list2.map(function (x) { return x.foo; })) | |
.size, "</p>" | |
); | |
document.write( | |
"<p>", list.some(function (x) { | |
return list2.some(function (y) { | |
return x.x == y.foo; | |
}); | |
}), "</p>" | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment