# JavaScript Quiz ⚡ push() & shift() array methods

Let's break it down 🔥

1. **shift()** removes the first element and returns the removed element.

2. **push()** adds the elements at the end of the array and returns the new length of the array 


```
const roles = ["DevOps", "Front-End", "Back-End", "Designer"];

``` 
👉 The current array length is **4**.


**roles.shift()**
Removing **DevOps** element from the array

👉 Now, array length becomes **3** because one element has been removed with the shift method.


**roles.push()** is adding the deleted **DevOps** element at the end of the array.

👉 After pushing "DevOps" back to the end of the array, the new length of the array will return to the last push method.


**roles.push()** 
At the end length, 4 will get pushed as an element at the end of the array.

So, the **output** will become:


```
['Front-End', 'Back-End', 'Designer', 'DevOps', 4]

``` 

