I actually asked myself the same question at the start of this year. UPDATED with new test cases http://jsperf.com/array-push-vs-unshift-vs-direct-assignment/2

It appears that push is much faster in chrome, and about equal in FF. Also direct is faster in IE9, but I would be interested to see how it performs in IE10.

I would say that most developers would assume setting the length of the array, and then using direct assignment is faster, as is the case with most programming languages. But JavaScript is different. Javascript arrays aren't really arrays, they're just key/value maps just like all other JavaScript objects. So the pre-allocation is essentially falling on deaf ears.

Personally I prefer push (:

Answer from gkiely on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org β€Ί en-US β€Ί docs β€Ί Web β€Ί JavaScript β€Ί Reference β€Ί Global_Objects β€Ί Array β€Ί push
Array.prototype.push() - JavaScript | MDN
The push() method of Array instances adds the specified elements to the end of an array and returns the new length of the array.
Discussions

Is there a reason JavaScript developers don't use Array.push()? - Stack Overflow
It appears that push is much faster in chrome, and about equal in FF. Also direct is faster in IE9, but I would be interested to see how it performs in IE10. I would say that most developers would assume setting the length of the array, and then using direct assignment is faster, as is the case with most programming languages. But JavaScript ... More on stackoverflow.com
🌐 stackoverflow.com
javascript - How can I push an object into an array? - Stack Overflow
Let's say, our array is myArray[], so this is now empty array, the JS engine does not know what type of data does it have, not string, not object, not number nothing. So, we are going to push an object (maybe empty object) into that array. More on stackoverflow.com
🌐 stackoverflow.com
javascript - Copy array items into another array - Stack Overflow
I have a JavaScript array dataArray which I want to push into a new array newArray. Except I don't want newArray[0] to be dataArray. I want to push in all the items into the new array: var newArra... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Push multiple elements to array - Stack Overflow
This would create and return a new array instead of pushing items to the same array. More on stackoverflow.com
🌐 stackoverflow.com
🌐
DEV Community
dev.to β€Ί technoph1le β€Ί the-javascript-arraypush-method-explained-5d4m
The JavaScript `Array.push()` method explained - DEV Community
November 24, 2022 - The Array.push() method adds one or more elements to the end of an array and returns the new length of the array.
🌐
Medium
medium.com β€Ί an-idea β€Ί javascript-arrays-push-pop-shift-unshift-adc8fb815fc0
JavaScript Arrays: push(), pop(), shift() & unshift() | by Amanda M Johnson | An Idea (by Ingenious Piece) | Medium
October 10, 2021 - push() adds one or more elements to the end of an array Β· returns the new element(s) is destructive, so the array itself will be mutated Β· relies on the length property to know where to insert the new element(s) and will default to 0 if there ...
🌐
daily.dev
daily.dev β€Ί home β€Ί blog β€Ί webdev β€Ί javascript push() and pop(): array methods guide
JavaScript push() and pop(): Array Methods Guide | daily.dev
March 29, 2024 - Let's wrap up what we've learned about using pop and push in JavaScript: array.push() helps you add items to the end of an array and tells you the new size.
Find elsewhere
🌐
freeCodeCamp
freecodecamp.org β€Ί news β€Ί how-to-insert-an-element-into-an-array-in-javascript
Push into an Array in JavaScript – How to Insert an Element into an Array in JS
November 7, 2024 - In case you're in a hurry, here ... original array let newArray = [].concat(Array, element); When you want to add an element to the end of your array, use push()....
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί javascript β€Ί how-to-push-an-array-into-the-object-in-javascript
How to Push an Array into Object in JavaScript? - GeeksforGeeks
July 12, 2025 - To push an array into the Object in JavaScript, we will be using the JavaScript Array push() method. First, ensure that the object contains a property to hold the array data.
🌐
freeCodeCamp
freecodecamp.org β€Ί news β€Ί insert-into-javascript-array-at-specific-index
How to Insert into a JavaScript Array at a Specific Index – JS Push
November 7, 2024 - JavaScript arrays are an important part of the language. They allow you to store and manipulate collections of data. Sometimes, you may need to insert a new element into an array at a specific index. To accomplish this task, you can use the push() method or the splice() method.
🌐
YouTube
youtube.com β€Ί watch
JavaScript Array Methods in Minutes: PUSH( ) β€” 3 EXAMPLES! - YouTube
Here is a rapid fire overview of the push( ) array method in JavaScript.CODEhttps://playcode.io/2395869πŸ§‘β€πŸ’» Up-skill with Codecademy! Get a full 50% off of ...
Published Β  June 30, 2025
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί javascript β€Ί javascript-array-push-method
JavaScript Array push() Method - GeeksforGeeks
The push() method in JavaScript adds one or more elements to the end of an array and returns the new length of the array.
Published Β  April 15, 2025
🌐
CodyHouse
codyhouse.co β€Ί blog β€Ί post β€Ί javascript-append-to-array
JavaScript quick tip - append to array with examples | CodyHouse
The spread operator (...) expands the second_array so that it can be passed directly to the push method, with no need of looping through all its element.
🌐
W3Schools
w3schools.com β€Ί js β€Ί js_array_methods.asp
JavaScript Array Methods
Popping items out of an array, or pushing items into an array.
🌐
Sencha
sencha.com β€Ί home β€Ί blog β€Ί how to add elements to the beginning of a javascript array: complete guide (2026)
Add Elements to Array Start in JavaScript - 2026 Guide
May 11, 2026 - For an array with 1,000,000 elements, that’s 1,000,000 shift operations. What happens internally when you prepend to [1, 2, 3]: ... Compare this to push(), which adds to the end β€” no shifting needed, just place the new element at the next available position.