Contact: aviboots(AT)netvision.net.il
39,845 questions
51,766 answers
573 users
let array = [4, 9, 8, 6, 5, 7, 1]; let index = 3; let newElement = 1000; // Insert the new element at the specified index array.splice(index, 0, newElement); console.log(array); /* run: [ 4, 9, 8, 1000, 6, 5, 7, 1 ] */