Skip to content

Instantly share code, notes, and snippets.

@weargoggles
Last active August 29, 2015 14:13
Show Gist options
  • Save weargoggles/798d0a9c7e4070cd4b50 to your computer and use it in GitHub Desktop.
Save weargoggles/798d0a9c7e4070cd4b50 to your computer and use it in GitHub Desktop.
ByRggV
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