Javascript most useful array functions
Tags: javascript, webdev
Published: 2021-06-06 05:22:34

## **push**

**push method adds one or more element at the end of an array**

![push](https://cdn.hashnode.com/res/hashnode/image/upload/v1622360006696/cjd2cwehH.png)

## **pop**

**pop is removed the last element of the array & return that element**

![pop](https://cdn.hashnode.com/res/hashnode/image/upload/v1622360127258/IQHoQCGdo.png)

## **shift**

**A shift method removes the first element from the array and all other element indexes decrease by 1**

![shift](https://cdn.hashnode.com/res/hashnode/image/upload/v1622360232875/vg9Z2g97p.png)


## **unshift**

**unshift method adds a new element at the beginning of an array and all other element indexes increase by 1**

![unshift](https://cdn.hashnode.com/res/hashnode/image/upload/v1622360414461/3P6sF_Kgf.png)

## **concat**

**concat method concat two or more array and return a new array**

![concat](https://cdn.hashnode.com/res/hashnode/image/upload/v1622360665184/gvqOb7-aA.png)

## **reverse**

**reverse  method reverses and returns the array**

![reverse](https://cdn.hashnode.com/res/hashnode/image/upload/v1622360834268/aDHtzE2T7.png)

## **slice**

**A slice method return portion of an array as a new array without touching the existing array it's accepted 2 optional arguments start index & end index**

![slice](https://cdn.hashnode.com/res/hashnode/image/upload/v1622362752120/JCFTpuY6y.png)

## **splice**

**splice method uses to add or remove an element from an array. It's accepted 3 argument start index, delete count & new elements, it's return deleted elements.**

![splice](https://cdn.hashnode.com/res/hashnode/image/upload/v1622362690494/0uWigq46d.png)

## **find**

**find method return a 1st element that match with given test**

![find](https://cdn.hashnode.com/res/hashnode/image/upload/v1622362842862/8urHh7H8h.png)

## **filter**

**filter method returns an element that matches with given test**

![filter](https://cdn.hashnode.com/res/hashnode/image/upload/v1622362929724/cgO2QoF7u.png)

## **some**

**some method returns true or false if one of the array element is pass in test condition **

![some](https://cdn.hashnode.com/res/hashnode/image/upload/v1622363953268/4S7ONR8_S.png)

## **every**

**every method checks whether all elements in an array pass the applied test and return true if pass else false**

![every](https://cdn.hashnode.com/res/hashnode/image/upload/v1622363114251/QR17PZvq9.png)

## **map**

**map method creates a new array with result to apply given function to each element**

![map](https://cdn.hashnode.com/res/hashnode/image/upload/v1622363907419/Owg-n78fQ.png)


## **sort**

**sort method short array in alphabetical order. it's sort array values as strings**


![sort](https://cdn.hashnode.com/res/hashnode/image/upload/v1622363511230/_dENck6aV.png)

 [More sorting example](https://jsfiddle.net/lochawala/cqwtyx7g/46/) 

## **reduce**

**reduce method reduces the array to a single value from left to right**

![reduce](https://cdn.hashnode.com/res/hashnode/image/upload/v1622469426144/YGw-rHJYQ.png)


## **Wrapping up!**

Share this blog with your friends 👩🏼‍🤝‍🧑🏼 and developers 👨‍💻 you know and let them know these

Your feedback and comments are very important to me. 💌

## **Get in touch 🤜🤛**

 [Instagram](https://www.instagram.com/technonic)