Example 1 — Official: Remove Two Numbers
The sample from the Ramda docs: remove every 1 and 2.
console.log(R.without([1, 2], [1, 2, 1, 3, 4]));
// [3, 4] How It Works
- Values. The first array,
[1, 2], lists what to throw away. - Check. Each item of
[1, 2, 1, 3, 4]is tested against those values. - Drop. Both
1s and the2match, so all three are skipped. - Result. Only
3and4are left, in their original order.
