September 2017
Intermediate to advanced
216 pages
6h 8m
English
Let's implement another intersect() function that uses method chaining to filter out the intersecting list values:
const intersection = (...lists) => List() .concat(...lists) .countBy(v => v) .toSeq() .filter(v => v === lists.length) .keySeq();
This is much easier to read. Let's break down what's happening here:
Read now
Unlock full access