lib/Insert Item in an Array.js
// program to insert an item at a specific index into an array
program to insert an item at a specific index into an array
program to insert an item at a specific index into an array
function insertElement() {
    let array = [1, 2, 3, 4, 5];
    let index = 3;
    let element = 8;
    array.splice(index, 0, element);
    console.log(array);
}
function insertElement ( ) { let array = [ 1 , 2 , 3 , 4 , 5 ] ; let index = 3 ; let element = 8 ; array . splice ( index , 0 , element ) ; console . log ( array ) ; }
program to insert an item at a specific index into an array
program to insert an item at a specific index into an array
// index to add to // element that you want to add