Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as JavaScript by arash ( 7 years ago )
function intersect(a1, a2, keyFor = x => x) {
const a1seen = Object.fromEntries(a1.map(x => [keyFor(x), true]));
return a2.filter(y => a1seen[keyFor(y)]);
}
Revise this Paste