// Suppose we have an array
let myArray = [2, 4, 6, 8, 10];
// Index where we want to insert the item
let indexToInsert = 3;
// Item we want to insert
let itemToInsert = 174;
// Now we Using splice() method to insert the item at the specified index
myArray.splice(indexToInsert, 0, itemToInsert);
// output with new value
console.log(myArray);