1Array.prototype.insert = function ( index, item ) {
2 this.splice( index, 0, item );
3};
1var fruits = ["Banana", "Orange", "Apple", "Mango"];
2document.getElementById("demo").innerHTML = fruits;
3
4function myFunction() {
5 fruits.splice(2, 0, "Lemon", "Kiwi");
6 document.getElementById("demo").innerHTML = fruits;
7}