Example 1 — Official: Remove Three Items
The sample from the Ramda docs: start at index 2 and remove 3 items.
console.log(R.remove(2, 3, [1, 2, 3, 4, 5, 6, 7, 8]));
// [1, 2, 6, 7, 8] How It Works
- Start. Index
2holds the value3(indexes begin at 0). - Count. Three items from there are
3,4, and5. - Copy.
R.removebuilds a new array without those three. - Result.
[1, 2]before the cut plus[6, 7, 8]after it.
