Remove or add items to an array at any position using .splice().
Source Code
let fruits = ['apple', 'banana', 'cherry'];
fruits.splice(1, 1, 'orange', 'pear'); // Removes 'banana', adds 'orange' and 'pear'
console.log(fruits); // ["apple", "orange", "pear", "cherry"]