Slice vs Splice vs Split
Slice
const arr = [1,2,3,4,5];
arr.slice(0, 1); // [1]
// These two are the same because omiting the `end` is the same as extracting
// through the end of the list (arr.length)
arr.slice(1); // [2,3,4,5]
arr.slice(1, 5); // [2,3,4,5]Splice
Last updated