What is the difference between splice
and slice
?
const array = [1, 2, 3, 4, 5];
array.splice(index, 1);
array.slice(index, 1);
What is the difference between splice
and slice
?
const array = [1, 2, 3, 4, 5];
array.splice(index, 1);
array.slice(index, 1);