How to Merge Two Arrays Without Creating a New Array in JavaScript? Last Updated : 05 Aug, 2025 Comments Improve Suggest changes Like Article Like Report Given two arrays, the task is to merge both arrays to make a single array without creating a new array in JavaScript. It modifies one array in place to store the merged array elements.We can use the array push() method to insert array elements into another array using Spread Operator. This approach will modify the first array in place and won't create a new array.Syntaxarray1.push( ...array2); JavaScript let array1 = [ 1, 2, 3 ]; let array2 = [ 4, 5, 6 ]; array1.push(...array2); console.log(array1); Output[ 1, 2, 3, 4, 5, 6 ] Please Read JavaScript Array Tutorial for complete understanding of JavaScript Array.Table of ContentUsing Array concat() MethodUsing Array splice() MethodUsing a for LoopUsing Array concat() MethodWe can use array concat() method to Merge Two Arrays Without Creating a New Array. It is a very basic method to merge arrays. It takes second array as a parameter and store the merged array to the first array. Syntaxarray1 = array1.concat( array2 ); JavaScript let array1 = [ 1, 2, 3 ]; let array2 = [ 4, 5, 6 ]; // Store the merged array to first array array1 = array1.concat(array2); console.log(array1); Output[ 1, 2, 3, 4, 5, 6 ] Using Array splice() MethodThe array splice() method is used to modify the contents of an array by removing the existing elements and/or by adding new elements.Syntaxarray1.splice( index, removeCount, ...array2 ) JavaScript let array1 = [ 1, 2, 3 ]; let array2 = [ 4, 5, 6 ]; array1.splice(array1.length, 0, ...array2); console.log(array1); Output[ 1, 2, 3, 4, 5, 6 ] Using a for LoopWe can also use for loop to merge two arrays without creating a new array. We will use for loop with push() method to merge arrays without creating new array. JavaScript let array1 = [ 1, 2, 3 ]; let array2 = [ 4, 5, 6 ]; for (let i = 0; i < array2.length; i++) { array1.push(array2[i]); } console.log(array1); Output[ 1, 2, 3, 4, 5, 6 ] Comment More info G geethabtrweh Follow Improve Article Tags : JavaScript Web Technologies javascript-array JavaScript-Program 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