JavaScript - Insert Multiple Elements in JS Array Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report These are the following ways to insert multiple elements in JavaScript arrays: 1. Using bracket Notation(Simple and Efficient for Small Array)The Bracket can be used to access the index of the given array and we can directly assign a value to that specific index. JavaScript let a = [2, 3, 4]; a[3] = 1; a[4] = 5; console.log(a); Output[ 2, 3, 4, 1, 5 ] 2. Using splice() Method (Efficient for Large Array)The splice() method can be used to insert elements to the given array, as it takes parameter where you have to add the position where you want to insert the element, the number of elements you want to remove(in this cse it is 0 as we are adding elements) and then the value that you want to insert. JavaScript let a = [10, 20, 30, 40]; a.splice(a.length, 0, ...[50, 60, 70]); console.log(a); Output[ 10, 20, 30, 40, 50, 60, 70 ] 3. Using spread Operator(Efficient for Large Array)This method creates a new array to insert elements. The JavaScript spread syntax (...) can be used to add multiple elements in the JS array. we can directly assign the array values to the new array. JavaScript let a1 = [2, 3]; // Inserts 0 at the start let a2 = [0, 1, ...a1]; console.log(a2); // Inserts 4,5 at the end let a3 = [...a1, 4, 5]; console.log(a3); Output[ 0, 1, 2, 3 ] [ 2, 3, 4, 5 ] Comment A amit_singh27 Follow 0 Improve A amit_singh27 Follow 0 Improve Article Tags : JavaScript Web Technologies javascript-array Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)9 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like