const arrayToBeFixed = ['a', 'b', 'wrong', 'f']
const removedElements = arrayToBeFixed.splice(2, // Where to insert
1, // number of elements to be removed from arrayToBeFixed
'c', 'd', 'e', // elements to add starting from the insertion index
);
console.log(arrayToBeFixed) // ['a' 'b', 'c', 'd', 'e', 'f']
console.log(removedElements) // ['wrong']