# Javascript Higher Array Methods

Looping through an array has its perks, depending on what we want to achieve or do. There are a lot of different array methods with each of them having its specific purpose.

I'll be going through 5 different array methods and their uses.

### ForEach()

This method executes a provided function for each element in an array. It is a better way to loop through an array than for loop.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675217318580/af2d2fe7-afc5-40bb-bcbe-9d178acaaa1f.png align="center")

### Map()

This method creates a new array. Instead of filtering elements out, map creates a new array.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675217507012/b9ae13dc-2938-4a80-8540-c224d395b122.png align="center")

### Filter()

It helps filter things from an array. It returns a new array with all elements that pass the test defined by the given function.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675217739055/0364d8f3-0681-4eff-be0b-8274d420a53a.png align="center")

### Sort()

This method sorts the items in an array in a specific order either ascending or descending.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675217912997/40f1e004-a69f-427e-9588-99a9757e7e28.png align="center")

### Reduce()

It works by executing a reducer function on each element of an array and returning a single value.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675218121661/2b14b1b3-d7db-4705-be08-a0a9d87b1c69.png align="center")

I hope this helps you to understand the array methods mentioned better. Thanks for reading.
