Js Array Methods
Tags: javascript, webdev, array, programming
Published: 2022-04-04 17:51:12

## 1. Array.length()
To find length of an Array using array.length method

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yem63rncqohww0vsh941.png)

## 2. Array.concat()

- To join two or more than two array.
- Returns new array.
- New array will not change existing array.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfrfnx66gyicnekkz4u3.png)

## 3. Array.every()

- To check given condition in every array element and returns boolean
- Every array element will pass the test return 'true'
- Any one element will fail the test return 'false'

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9o5m0e4i9mm766h2uro2.png)

## 4. Array.fill()
- Array.fill() method fills some specify element in an array.
- It affects original array.
- Start and end position will not specified, entire array elements fills with given value


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b37j58go9z7271wivodb.png)

## 5. Array.find()
- Array.find() method return the condition will be true the first element in given array.
- If condition will not pass in given array it return 'Undefined'

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/es38adjyujnbbn7qms4u.png)


## 6. Array.findIndex()
- FindIndex method return the index position where the condition first satisfy.
- If condition will not satisfy return -1.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1k811xnu50tvfi4esfi6.png)

## 7. Array includes()
- Includes method return boolean value.
- If given specified value in array it will return true else return false.
- Include method is case sensitive.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4exvor6roia2igwoncr5.png)

## 8. Array.push()
- Array push method insert a new element at last position in given array.
- Push method will affect original array.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlu2fms18jwo2344bf0k.png)

## 9. Array.pop()
- Array pop method remove last element in given array.
- It will also affect original array.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1a9ez6zeq08mdiwqwz0c.png)

## 10. Array.shift()
- Shift method will remove the first element of the array.
- It will changes the original array.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmd5wslmvhny9whpn1ml.png)

## 11. Array.unshift()
- Unshift method will add the new element at first position of the array.
- It will overwrites the original array.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm8iwcztwfr2rusknpjx.png)

## 12. Array.slice()
- Slice method return a new copy of array when selected element.
- It like The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0i69gb2ppezuj0fd9d8d.png)

## 13. Array.sort()
- Sort method return sorted array.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpkhfkz1iysigtu921ni.png)