// splice method
// replace Mongo as olive using splice
const FRUITS = ["Banana", "Orange", "Lemon", "Apple", "Mango"];
let ind=FRUITS.indexOf("Mango");
console.log(ind); // 4
console.log(FRUITS.splice(ind,1,'olive')); //deleted data is [ 'Mango' ]
console.log(FRUITS); // [ 'Banana', 'Orange', 'Lemon', 'Apple', 'olive' ]