---
title: "Understanding the push() Method in JavaScript Arrays."  
description: "Understanding the push() Method in JavaScript Arrays."  
author: "Ashutosh Patel"  
published: 2024-12-23  
updated: 2025-01-01  
canonical: https://www.mindstick.com/forum/161075/understanding-the-push-method-in-javascript-arrays  
category: "javascript"  
tags: ["javascript", "javascript array", "javascript method"]  
reading_time: 1 minute  

---

# Understanding the push() Method in JavaScript Arrays.

[Explain the working](https://answers.mindstick.com/qa/33651/explain-the-working-of-google-adwords) of the [push](https://www.mindstick.com/forum/23133/push-not-showing-when-app-is-open)() [Method](https://www.mindstick.com/forum/166/webservice-method) in [JavaScript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) Arrays.

## Replies

### Reply by Khushi Singh

The push() method is one of many JavaScript Collection methods that allows appending one or more elements to an array. It modifies the original passed array and returns the new size of the array.

Syntax:

```javascript
array.push(element1, element2, ..., elementN);
```

Example:

```javascript
let fruits = ['apple', 'banana'];
fruits.push('orange');
console.log(fruits); // Output: ['apple', 'banana', 'orange']
```

Key Points:

- It inserts elements at the beyond the end of the array.
- The method modifies the passed array (the array is mutated).
- Returns the new length of the array on successful completion of the built-in operations.

This is one of those methods that most people are familiar with, and it is quite easy to implement to add data to the arrays dynamically!

\
Explore more about [Java script Arrays](https://www.mindstick.com/articles/336228/explain-the-javascript-arrays)


---

Original Source: https://www.mindstick.com/forum/161075/understanding-the-push-method-in-javascript-arrays

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
