slice vs splice
slice-vs-splice
3 Differences
1. Returns
slice
returns up to but not including the second argument
splice
returns up to the second argument
2. Mutability
slice()
is known as an accessor method which does not modify the array but instead returns a representation via a new Array object.
splice
is known as a mutator method because it does mutate the original array.
3.Number of arguments
slice
From N to delete N-1
splice
From N to delete N item