Remove or add elements within an array.
Source Code
let fruits = ["Apple", "Banana", "Orange", "Mango"];
fruits.splice(2, 1, "Lemon", "Kiwi");
console.log(fruits); // ["Apple", "Banana", "Lemon", "Kiwi", "Mango"]
Remove or add elements within an array.
let fruits = ["Apple", "Banana", "Orange", "Mango"];
fruits.splice(2, 1, "Lemon", "Kiwi");
console.log(fruits); // ["Apple", "Banana", "Lemon", "Kiwi", "Mango"]