You can push multiple elements into an array in the following way

var a = [];
    
a.push(1, 2, 3);

console.log(a);

Answer from amit1310 on Stack Overflow
๐ŸŒ
Bacancy Technology
bacancytechnology.com โ€บ qanda โ€บ javascript โ€บ push-multiple-elements-to-array-in-javascript
How to Push Multiple Elements to Array in JavaScript
let a = []; Array.prototype.push.apply(a, [1, 2]); console.log(a); // [1, 2] Alternatively, you can use the spread operator, which is often simpler and more modern: let a = []; a.push(...[1, 2]); console.log(a); // [1, 2] Work with our skilled ...
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ javascript โ€บ standard-library โ€บ Array โ€บ push
JavaScript Array push() - Add Elements to Array | Vultr Docs
September 27, 2024 - Start with an established array. Use the push() method to simultaneously add multiple elements.
๐ŸŒ
Quora
quora.com โ€บ How-do-you-push-multiple-objects-into-an-array
How to push multiple objects into an array - Quora
1. Push() 2. Unshift() 3. Spread operator 1. Push(): This operator add multiple items in end of an array. # Lets take an empty array [code]let array = []; [/code]#add elements using push operator [code...
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_push.asp
JavaScript Array push() Method
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST ... Array[ ] Array( ) at() concat() constructor copyWithin() entries() every() fill() filter() find() findIndex() findLast() findLastIndex() flat() flatMap() forEach() from() includes() indexOf() isArray() join() keys() lastIndexOf() length map() of() pop() prototype push() reduce() reduceRight() rest (...) reverse() shift() slice() some() sort() splice() spread (...) toReversed() toSorted() toSpliced() toString() unshift() values() valueOf() with() JS Boolean
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ bytes โ€บ push-an-object-to-an-array-in-javascript
Push an Object to an Array in JavaScript
July 23, 2022 - To achieve this, we'll use the ... and it will add it to the end of the array. To add multiple objects to an array, you can pass multiple objects as arguments to the push() method, which will add all of the items to the end of the array....
Find elsewhere
๐ŸŒ
Quora
quora.com โ€บ How-do-I-add-multiple-objects-to-a-single-array-list-in-Javascript
How to add multiple objects to a single array list in Javascript - Quora
Answer (1 of 4): To add multiple objects to a single array , there are two functions you can use : 1. push() : Using this function you can append as many values you want to the array giving one at a time . for eg: var arr=[] [code ]arr.push ...
๐ŸŒ
RSWP Themes
rswpthemes.com โ€บ home โ€บ javascript tutorial โ€บ how to push multiple objects in array in javascript
How To Push Multiple Objects In Array In Javascript
March 26, 2024 - In this article, we will explore the step-by-step process of pushing multiple objects into an array in JavaScript.
๐ŸŒ
HubSpot
blog.hubspot.com โ€บ home โ€บ the hubspot website blog
Everything You Need to Know About the JavaScript Array ...
HubSpotโ€™s Website Blog covers everything you need to know to build maintain your companyโ€™s website.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ javascript-array-push-method
JavaScript Array push() Method - GeeksforGeeks
The array push() function adds one or more values to the end of the array and returns the new length. This method changes the length of the array. An array can be inserted into the object with push() function.
Published ย  April 15, 2025
๐ŸŒ
Shiksha
shiksha.com โ€บ home โ€บ it & software โ€บ it & software articles โ€บ programming articles โ€บ javascript array push
JavaScript Array Push - Shiksha Online
December 18, 2023 - The JavaScript array.push() method adds one or more elements to the end of an array, directly modifying the original array.
๐ŸŒ
GitHub
github.com โ€บ bobbyhadz โ€บ javascript-push-multiple-values-to-array
GitHub - bobbyhadz/javascript-push-multiple-values-to-array: A repository for an article at https://bobbyhadz.com/blog/javascript-push-multiple-values-to-array
A repository for an article at https://bobbyhadz.com/blog/javascript-push-multiple-values-to-array - bobbyhadz/javascript-push-multiple-values-to-array
Author ย  bobbyhadz
๐ŸŒ
EDUCBA
educba.com โ€บ home โ€บ software development โ€บ software development tutorials โ€บ javascript tutorial โ€บ javascript array push
JavaScript Array Push | Adding Elements in Array with Different Examples
June 9, 2023 - In this way, we can use multiple ... value is directly assigned using an index. We can use the push() method to add the elements at the end of an array, increasing its length. This is a guide to JavaScript Array Push...
Call ย  +917738666252
Address ย  Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
๐ŸŒ
Medium
habtesoft.medium.com โ€บ add-elements-to-an-array-in-javascript-a9cc6cd9469f
Add elements to an array in JavaScript | by habtesoft | Medium
October 18, 2024 - In this example, we have an array of numbers and we use the push() method to add a single element and multiple elements to the end of the array. ... The splice() method can also be used to add elements to an array in JavaScript.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnjavascript โ€บ using push a few times or just once
r/learnjavascript on Reddit: Using push a few times or just once
March 4, 2023 -

Hey, so maybe this is a silly question but I was wondering how to measure the performance of push method, would it be preferable to push a few elements into an array at once or just push it a couple of times? I'm using console.time method to measure the diff between these two approaches, maybe there is a better/more reliable way to test this?

Example:

// one call to push method

arr.push({a:'a', b: 'b'}, {c:'c', d: 'd'});

// n calls to push method

arr.push({a:'a', b: 'b'});

arr.push({c:'c', d: 'd'});

It's just to see which one is faster more than the obvious thing to do (just push it all in one call)

๐ŸŒ
SamanthaMing
samanthaming.com โ€บ tidbits โ€บ 87-5-ways-to-append-item-to-array
5 Way to Append Item to Array in JavaScript | SamanthaMing.com
The simplest way to add items to the end of an array is to use push. const zoo = ['๐ŸฆŠ', '๐Ÿฎ']; zoo.push('๐Ÿง'); console.log(zoo); // ['๐ŸฆŠ', '๐Ÿฎ', '๐Ÿง'] Notice I said items and not just item ๐Ÿ˜‰ Yup, you can push multiple items.