JavaScript- Append in Array Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report These are the following ways to append an element to the JS array: 1. Using Array.push() MethodJavaScript array.push() Method is used to add one or more elements to the end of the array. JavaScript let a = [ 10, 20, 30, 40, 50 ]; a.push(90); console.log(a); Output[ 10, 20, 30, 40, 50, 90 ] 2. Using Spread Operator with Array LiteralJavascript spread operator allows an iterable to expand in places where 0+ arguments are expected. It is mostly used in the variable array where there is more than 1 value is expected. It allows us the privilege to obtain a list of parameters from an array. JavaScript let a = [ 10, 20, 30, 40, 50 ]; // Pushing 90 to the original array a = [ ...a, 90 ] console.log(a); Output[ 10, 20, 30, 40, 50, 90 ] 3. Using JavaScript splice() MethodJavaScript splice() Method modifies the content of an array by removing existing elements and/or adding new elements. It allows us to add elements inside the array at specific index. JavaScript let a = [ 10, 20, 30, 40, 50 ]; // Update array using slice a.splice(2, 0, 90); console.log( a); Output[ 10, 20, 90, 30, 40, 50 ] We can also append arrays in the existing array by combining them together.4. Using JavaScript concat() MethodJavaScript concat() Method returns a new combined array comprised of the array on which it is called, joined with the array (or arrays) from its argument. This method is used to join two or more arrays and this method does not change the existing arrays, but returns a new array, containing the values of the joined arrays. JavaScript let a1 = [ 10, 20 ] let a2 = [ 30, 40 ] let a3 = [ 50 ]; // Append a2 and a3 into a1 let a = a1.concat(a2, a3); console.log(a); Output[ 10, 20, 30, 40, 50 ] Comment More infoAdvertise with us R rathbhupendra Follow Improve Article Tags : JavaScript Web Technologies javascript-array JavaScript-DSA JavaScript-Questions +1 More Explore JavaScript BasicsIntroduction to JavaScript4 min readJavaScript Versions2 min readHow to Add JavaScript in HTML Document?3 min readJavaScript Syntax6 min readJavaScript Output4 min readJavaScript Comments2 min readVariables & DatatypesVariables and Datatypes in JavaScript6 min readGlobal and Local variables in JavaScript4 min readJavaScript Let6 min readJavaScript const5 min readJavaScript Var Statement7 min readOperatorsJavaScript Operators5 min readOperator precedence in JavaScript2 min readJavaScript Arithmetic Operators5 min readJavaScript Assignment Operators5 min readJavaScript Comparison Operators5 min readJavaScript Logical Operators5 min readJavaScript Bitwise Operators5 min readJavaScript Ternary Operator4 min readJavaScript Comma Operator2 min readJavaScript Unary Operators4 min readJavaScript in and instanceof operators3 min readJavaScript String Operators3 min readStatementsJavaScript Statements4 min readJavaScript if-else3 min readJavaScript switch Statement4 min readJavaScript Break Statement2 min readJavaScript Continue Statement1 min readJavaScript Return Statement4 min readLoopsJavaScript Loops3 min readJavaScript For Loop4 min readJavaScript While Loop3 min readJavaScript For In Loop3 min readJavaScript for...of Loop3 min readJavaScript do...while Loop4 min readPerformance & DebuggingJavaScript | Performance4 min readDebugging in JavaScript4 min readJavaScript Errors Throw and Try to Catch2 min readObjectsObjects in Javascript4 min readObject Oriented Programming in JavaScript3 min readJavaScript Objects6 min readCreating objects in JavaScript5 min readJavaScript JSON Objects3 min readJavaScript Object Reference4 min readFunctionsFunctions in JavaScript5 min readHow to write a function in JavaScript ?4 min readJavaScript Function Call2 min readDifferent ways of writing functions in JavaScript3 min readDifference between Methods and Functions in JavaScript3 min readExplain the Different Function States in JavaScript3 min readJavaScript Function Complete Reference3 min readArraysJavaScript Arrays7 min readJavaScript Array Methods7 min readBest-Known JavaScript Array Methods6 min readImportant Array Methods of JavaScript7 min readJavaScript Array Reference4 min readStringJavaScript Strings6 min readJavaScript String Methods9 min readJavaScript String Reference4 min read Like